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’);

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter13: Views
Section: Chapter Questions
Problem 3MC
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
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Fundamentals of Information Systems
Fundamentals of Information Systems
Computer Science
ISBN:
9781337097536
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning