Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
proj
create table Test(id integer, title varchar(100)); insert into Test(id, title) values(1, "Hello"); select * from Test; -- Your code here! create table post ( postid int(6) not null, timestamp_ timestamp not null, userid varchar(25) not null, primary key(postid)و unique(postid)و foreign key (userid) references userr (userid); ); insert into post values(184733,'2021-04-03 12:40:36','arwa123'); insert into post values(656738,'2020-01-09 02:48:03','sara232'); insert into post values(184771,'2017-11-24 01:32:24','alhanof'); insert into post values(196402,'2016-10-14 11:14:17','asma344'); insert into post values(049857,'2016-08-06 13:09:11','reem23t'); create table userr ( userid varchar(25) not null, pass varchar(25) not null, email varchar(25), profile_ blob(25), primary key (userid), unique(userid) unique(email) ); insert into userr values('arwa123','arw233','arwa773@gmail.com',null); insert into userr values('sara232','sar878','sara9@hotmail.com',null); insert into userr values('alhanof','090909','alhanof@gmail.com',null); insert into userr values('asma344','a67676','asm34@hotmail.com',null); insert into userr values('reem23t','ree223','reem23t@gmail.com',null); create table link ( URL varchar(25), postid int(6) not null, primary key (postid), ); insert into link values('http//erhdfrghj',099878); insert into link values('http//iuydhnbdoi',345678); insert into link values('http//jhgfdserg',345678); insert into link values('httpknbvdswertm',234567); insert into link values('http/oigfdserjj',336798); create table textt( numofchar int(128), postid int(6) not null , primary key (postid), ); insert into textt values(13330,666); insert into textt values(13370,444); insert into textt values(13380,555); insert into textt values(13390,151); insert into textt values(13310,646); create table image( name varchar(25), extension varchar(25), postid int(6) not null , primary key (postid), ); insert into image values('nouf','ect',13213); insert into image values('nour','tce',33213); insert into image values('noun','cet',22213); insert into image values('noum','ttt',12213); insert into image values('noue','ccc',13313); create table video ( namee varchar(25), duration decimal(25), extensionn int(25), postid int(6) not null , primary key (postid), ); insert into video values('ahmd','1234.5',2,123); insert into video values('mhmd','1444.5',3,223); insert into video values('rame','1334.5',4,113); insert into video values('assd','1224.5',6,333); insert into video values('ammn','1114.5',2,883); create table joint ( postid int(6) not null , uniqetitle varchar(25) not null , hashtag varchar(25), foreign key (postid) references textt (postid); foreign key (uniqetitle) references trend (uniqetitle); ); insert into joint values(9876,'reading','#Best story'); insert into joint values(9876,'Writing','#best book'); create table trend ( uniquetitle varchar (25) not null, numofjoin int(500), ranking int(10), primary key(uniqetitle), unique(uniquetitle) unique(ranking) ); insert into trend values('reading',200,8); insert into trend values('Writing',300,9); create table replay ( replayid int(6) not null, postid int(6) not null, userid varchar(25) not null, primary key(replayid), foreign key (postid) references post (postid); foreign key (userid) references userr (userid); ); insert into replay values(200332,184733,'arwa123'); insert into replay values(200366,184733,'arwa123'); insert into replay values(200384,184733,'arwa123'); insert into replay values(200398,184733,'arwa123'); insert into replay values(200312,184733,'arwa123'); create table likee ( postid int(6) not null, userid varchar(25) not null, foreign key (postid) references post (postid); foreign key (userid) references userr (userid); ); insert into likee values(184733,'arwa123'); insert into likee values(184733,'sara232'); insert into likee values(184733,'alhanof'); insert into likee values(656738,'arwa123'); insert into likee values(184771,'arwa123'); create table userlocation( userid varchar(25) not null , locattion varchar(25) not null , primary key(userid , locattion), ); insert into userlocation values('arw123','Riyadh'); insert into userlocation values('ryan12','Makkah'); insert into userlocation values('arw123','Riyadh'); insert into userlocation values('ryan12','Makkah'); insert into userlocation values('ryan12','Makkah'); create table follow ( userid varchar(25) not null , follow varchar(25) not null, primary key(userid , follow), ); insert into follow values('ryan12','arw123'); insert into follow values('thrya7','arw123'); insert into follow values('nour55','tareq1'); insert into follow values('aman66','arw123'); insert into follow values('nasr33','arw123'); create table premier( userid varchar(25), payment varchar(25), numofads varchar (25), ); insert into premier values('ryan12','5000','100'); insert into premier values('arw123','6000','200'); create table contract ( idads varchar(25) not null , userid varchar(25), paymentt decimal(25), primary key(idads , userid), ); insert into contract values('123456','rema4','98.99'); insert into contract values('123789','Alha5','77.55'); insert into contract values('123111','hifa7','55.77'); insert into contract values('123222','modd7','39.30'); insert into contract values('123777','asma7','20.50'); create table ads( idads varchar(25) not null , content text (25), price decimal(25), company varchar(25), numofview integer (25), primary key (idads), ); insert into ads values('0000000099','Sport club','1500.70','Fitness',100); insert into ads values('0000000089','New coffee','1400.70','Nia',200); insert into ads values('0000000059','New clothes store','1300.70','Dale',300); insert into ads values('0000000039','New restaurant','1200.70','Bellow',400); insert into ads values('0000000029','educational club','1600.70','Omar Foundation',500); create table bankinfo ( iban varchar(25) not null, fname varchar(25), mname varchar(25), lanme varchar(25), bankname varchar(25), useridd varchar (25), primary key (iban), foreign key (userid) references(user), ); Insert into bankinfo values ('SA123456789','hnof','abudalaz','Alta','AlBlad','hnouf77'); insert into bankinfo values ('SA123448888','ahma','mohammad','algh','albald','ahm2322'); insert into bankinfo values ('SA983947843','reem','baadeeer','alta','albald','remoo99'); insert into bankinfo values ('SA478687383','asad','saaleeem','aloa','alblad','soso666'); insert into bankinfo values ('SA345678909','sara','maahhhaa','easa','alblad','sa34566');
run
|
edit
|
history
|
help
-1
My name is busy
mysql - order by,limit,offset
Práctica MySQL 2
ITM_14210069
test
How to run query to keep maximum 3 rows with the same name
..
ruthresh
Test for MySQL "serializable" transaction, part 2
one