Student scores create tables and databases

Source: Internet
Author: User

Use Mastergoif EXISTS (SELECT name from sys.sysdatabases WHERE name = ' STUDENT ') DROP database studentgocreate database STUD Entgouse studentgocreate table Member (MID CHAR (Ten) PRIMARY KEY, Mname CHAR (not NULL) gocreate table F (FID char) PR Imary Key, FName char (a) not NULL) Gocreate TABLE score (SID INT IDENTITY () PRIMARY key, FID CHAR (Ten) FOREIGN key (FID) REFERENCES F (FID), Mid CHAR (Ten) FOREIGN KEY (mid) REFERENCES Member (mid), score INT not NULL) Goinsert into dbo. Member (MID, Mname) VALUES (' M001 ', ' Zhang San ') INSERT into dbo. Member (MID, Mname) VALUES (' M002 ', ' John Doe ') INSERT into dbo. Member (MID, Mname) VALUES (' M003 ', ' Harry ') INSERT into dbo. Member (MID, Mname) VALUES (' M004 ', ' Zhao Liu ') INSERT into dbo. Member (MID, Mname) VALUES (' M005 ', ' small Seven ') INSERT into dbo. Member (MID, Mname) VALUES (' M006 ', ' Forest One ') INSERT into dbo. Member (MID, Mname) VALUES (' M007 ', ' including ') INSERT into dbo. Member (MID, Mname) VALUES (' M008 ', ' Mountain Mountain ') INSERT into dbo. Member (MID, Mname VALUES (' M009 ', ' Tian Li ') INSERT into dbo. Member (MID, Mname) VALUES (' M010 ', ' Liu Kai ') INSERT into dbo. F (FID, FName) VALUES (' F001 ', ' language ') INSERT into dbo. F (FID, FName) VALUES (' F002 ', ' math ') INSERT into dbo. F (FID, FName) VALUES (' F003 ', ' English ') INSERT into dbo. F (FID, FName) VALUES (' F004 ', ' history ') insert into score (Fid,mid,score) VALUES (' F001 ', ' M001 ', +) insert INTO score (Fid,mid, Score) VALUES (' F002 ', ' M001 ', ") insert into score (Fid,mid,score) VALUES (' F003 ', ' M001 ',") insert into score (Fid,mid, Score) VALUES (' F004 ', ' M001 ', *) insert INTO score (Fid,mid,score) VALUES (' F001 ', ' M002 ', and ",") insert into score (Fid,mid, Score) VALUES (' F002 ', ' M002 ', ') insert into score (Fid,mid,score) VALUES (' F003 ', ' M002 ', ' + ') insert into score (Fid,mid, Score) VALUES (' F004 ', ' M002 ', ') insert into score (Fid,mid,score) VALUES (' F001 ', ' M003 ', ") insert into score (Fid,mid, Score) VALUES (' F002 ', ' M003 ', and all) insert into score (Fid,mid,score) VALUES (' F003 ', ' M003 ', ") insert into score (Fid,mid, Score) VALUES (' F004 ', ' M003 ', *) INSERT into SCore (Fid,mid,score) VALUES (' F001 ', ' M004 ', ') insert into score (Fid,mid,score) VALUES (' F002 ', ' M004 ', +) insert INTO Score (Fid,mid,score) VALUES (' F003 ', ' M004 ',) insert INTO score (Fid,mid,score) VALUES (' F004 ', ' M004 ', $) insert into Score (Fid,mid,score) VALUES (' F001 ', ' M006 ',) insert INTO score (Fid,mid,score) VALUES (' F002 ', ' M006 ', ") insert INTO Score (Fid,mid,score) VALUES (' F003 ', ' M006 ',) insert INTO score (Fid,mid,score) VALUES (' F004 ', ' M006 ', ") insert INTO Score (Fid,mid,score) VALUES (' F002 ', ' M007 ',) insert INTO score (Fid,mid,score) VALUES (' F003 ', ' M008 ', +) insert INTO Score (Fid,mid,score) VALUES (' F004 ', ' M007 ',) insert INTO score (Fid,mid,score) VALUES (' F004 ', ' M009 ', ") insert INTO Score (Fid,mid,score) VALUES (' F002 ', ' M009 ', 88)

  

Student scores create tables and databases

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.