For task 2 to 3, please provide the SQL commands for fulfilling the tasks, including creating the database and tables, along with a screenshot of the results that you can pop up from the SQL server after finishes the tasks.
For task 2 to 3, please provide the SQL commands for fulfilling the tasks, including creating the database and tables, along with a screenshot of the results that you can pop up from the SQL server after finishes the tasks.
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
Related questions
Question

Transcribed Image Text:2. Creating the tables with SQL commands:
CREATE TABLE Students (
sid INT PRIMARY KEY,
name VARCHAR(30),
login VARCHAR(30),
age INT,
gpa FLOAT
);
CREATE TABLE Enrolled (
sid INT,
cid VARCHAR(10),
grade CHAR(1),
PRIMARY KEY (sid, cid),
FOREIGN KEY (sid) REFERENCES
Students(sid)
2:
3. Filling the tables:
INSERT INTO Students (sid, name, login, age,
gpa) VALUES
(500132, 'Alice', 'alice@cs', 18, 3.5),
(500133, 'Bob', 'bob@ee', 18, 3.3),
(500134, 'Bob', 'bob@math', 19, 3.6);
INSERT INTO Enrolled (sid, cid, grade) VALUES
(500132, 'CS1011', 'C'),
(500132, 'CS1012', 'B'),
(500134, 'MA1003', 'D'),
(500133, 'EE2004', 'A');

Transcribed Image Text:2. For task 2 to 3, please provide the SQL commands for
fulfilling the tasks, including creating the database and
tables, along with a screenshot of the results that you
can pop up from the SQL server after finishes the
tasks.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 5 steps with 4 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education