5.1) 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.

Database Systems: Design, Implementation, & Management
11th Edition
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:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Chapter10: Transaction Management And Concurrency Control
Section: Chapter Questions
Problem 1P
icon
Related questions
Question

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

 

5.1) 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.

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

 

 

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

 

 

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

 

 

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

 

 

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

 

 

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

 

 

5.2) Show the output of each of the following queries. Assume that the queries are executed after executing the previous INSERT statements:

  1. SELECT *

   FROM Students;

 

 

 

 

 

 

 

  1. SELECT S.sname, C.cname

   FROM Students S, Courses C, Register R

   WHERE R.sid = S.sid and R.cid = C.cid

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
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