For each of the following statements, show whether the statement is correctly executed or not (assume that the statements are executed in order, which means that if a statement is correctly executed, its effect is reflected in the following statement). If you say the statement is not executed, explain why. a. INSERT INTO Students VALUES (3, ‘Ellen’);

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

CREATE the following table on mySQL

Consider the following database instance.

Table name: Students  Primary key: sid

Sid

sname

7

Ricky

2

Ellen

6

MaryLou

4

Ellen

 

Table name: Courses  Primary key: cid

cid

cname

1

ICS

2

Finance

 

Table name: Register Primary key: sid,cid

Foreign key: sid references Students(sid)

Foreign key: cid references Courses(cid)

sid

cid

7

2

2

2

7

1

4

1

check_circle

Expert Answer

thumb_up
 
thumb_down
Step 1

Here have to determine sql statement for given problem.

Step 2

Answer,:::

Here i have given Sql query statment of your given problem statement.

1) CREATE TABLE Students (

    Sid int not null primary key,

    sname varchar(255)

);

INSERT INTO Students 

    (Sid, sname) 

VALUES 

(7, "Ricky"),

(2, "Ellen"),

(6, "MaryLou"),

(4, "Ellen") ;

 

2) CREATE TABLE Courses (

    Cid int not null primary key,

    cname varchar(255)

);

INSERT INTO Courses 

    (Cid, cname) 

VALUES 

(1, "ICS"),

(2, "finance");

 

3) CREATE TABLE Register (

    Sid int not null,

Cid int not null,

FOREIGN KEY (cid) REFERENCES Courses(cid),

 FOREIGN KEY (sid) REFERENCES student (sid)

);

For each of the following statements, show whether the statement is correctly executed or not (assume that the statements are executed in order, which means that if a statement is correctly executed, its effect is reflected in the following statement). If you say the statement is not executed, explain why.

a. INSERT INTO Students VALUES (3, ‘Ellen’);

 

 

 

b. INSERT INTO Students VALUES (6, ‘Ellen’);

 

 

c. INSERT INTO Register VALUES (1, 2);

 

 

d. INSERT INTO Courses VALUES (5, ‘Systems’);

 

 

e. INSERT INTO Register VALUES (6, 5);

 

 

f. INSERT INTO Register VALUES (3, 5);

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education