Thiết Kế CSDL Quản Lý Sinh Viên - Lập Trình Sql Server - GokiSoft

Võ Như Việt

2021-04-03 08:31:55

create table SinhVien( rollno nvarchar(4) primary key, fullname nvarchar(50), age int, adddress nvarchar(50), email nvarchar(50), phoneNumber nvarchar(10), gender nvarchar(5) ) insert into SinhVien(rollno,fullname,age,adddress,email,phoneNumber,gender) values ('001','Tran Van A', 20,'Tran Dai Nghia','a@gmail.com','0123456789','nam'), ('002','Tran Van B', 22,'Tran Dai Nghia','b@gmail.com','0123456789','nu'), ('003','Tran Van C', 24,'Tran Dai Nghia','c@gmail.com','0123456789','nam'), ('004','Tran Van D', 26,'Tran Dai Nghia','d@gmail.com','0123456789','nu'), ('005','Tran Van E', 28,'Tran Dai Nghia','e@gmail.com','0123456789','nam') -- Mon Hoc-- create table MonHoc( object_Number int primary key identity(1,1), object_Names nvarchar(20) ) insert into MonHoc(object_Names) values ('HTML'), ('Lap Trinh SQL Server'), ('CSS/JS') --bo sung mon hoc-- insert into MonHoc(object_Names)values ('Java'), ('Android') select * from MonHoc -- Bang Diem-- create table BangDiem( Mark int, rollno nvarchar(4), object_Number int, primary key(rollno,object_Number) ) insert into BangDiem(Mark,rollno,object_Number) values (9,'001',1), (7,'002',2), (8,'003',3) --bosung diem-- insert into BangDiem(Mark,rollno,object_Number) values (6,'004',4), (10,'005',5) select * from BangDiem -- Bang Lop-- create table Class_C( Class_No int identity(1,1), Class_Names nvarchar(10), rollno nvarchar(4) ) insert into Class_C(Class_Names,rollno) values ('C2010L','001'), ('C2011L','002'), ('C2012L','003'), ('C2013L','004'), ('C2014L','005') -- Phong Hoc-- create table Room_C( Room_Names nvarchar(10), Room_No int primary key identity(1,1), No_table int, No_chair int, Id_Class nvarchar(5) ) insert into Room_C(Room_Names,No_table,No_chair,Id_Class) values ('Lab1',6,11,'CL10'), ('Lab2',7,13,'CL11'), ('Lab3',8,15,'CL12'), ('Lab4',9,17,'CL13'), ('Lab5',10,19,'CL14') select * from Room_C

Từ khóa » đồ An Quản Lý Sinh Viên Sql