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
![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');](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fb8a9802b-ded9-4a7b-93c8-71218002814a%2F42dac243-4c3f-49b8-8df2-5e67db2c3285%2Fuw9xpma_processed.jpeg&w=3840&q=75)
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');
![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.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fb8a9802b-ded9-4a7b-93c8-71218002814a%2F42dac243-4c3f-49b8-8df2-5e67db2c3285%2Fe2hn6u_processed.jpeg&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
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
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
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](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education