Step 5. Print student records with AGE >=20 as given in Figure 4 ('Rohan', 'MAE', 43, 'B', 20) ('Amit', 'ECE', 24, 'A', 21) ('Anil', 'MAE', 45, 'B', 20) ('Megha', 'ECE', 55, 'A', 22)

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
Step 5. Print student records with AGE >=20 as given in
Figure 4
('Rohan', 'MAE', 43, 'B', 20)
('Amit', 'ECE', 24, 'A', 21)
('Anil', 'MAE', 45, 'B', 20)
('Megha', 'ECE', 55, 'A', 22)
Figure 4: Records with Age >=20
Step 6. Display records in descending order of NAME field
using order by clause as shown in Figure 5.
('Sita', 'CSE', 95, 'A', 19)
('Rohan', 'MAE', 43, 'B', 20)
('Ram', 'CSE', 85, 'B', 19)
('Nisha', 'CSE', 99, 'A', 18)
('Nikhil', 'CSE', 98, 'A', 18)
('Megha', 'ECE', 55, 'A', 22)
('Anil', 'MAE', 45, 'B', 20)
('Amit', 'ECE', 24, 'A', 21)
Figure 5: Display using NAME in Descending Order
Transcribed Image Text:Step 5. Print student records with AGE >=20 as given in Figure 4 ('Rohan', 'MAE', 43, 'B', 20) ('Amit', 'ECE', 24, 'A', 21) ('Anil', 'MAE', 45, 'B', 20) ('Megha', 'ECE', 55, 'A', 22) Figure 4: Records with Age >=20 Step 6. Display records in descending order of NAME field using order by clause as shown in Figure 5. ('Sita', 'CSE', 95, 'A', 19) ('Rohan', 'MAE', 43, 'B', 20) ('Ram', 'CSE', 85, 'B', 19) ('Nisha', 'CSE', 99, 'A', 18) ('Nikhil', 'CSE', 98, 'A', 18) ('Megha', 'ECE', 55, 'A', 22) ('Anil', 'MAE', 45, 'B', 20) ('Amit', 'ECE', 24, 'A', 21) Figure 5: Display using NAME in Descending Order
Task
Specification:
Step 1. Assume that MySQL connector is already installed. If
not use
pip3 install
mysql-connector-python
to install mysql-connector. After doing so, Create Data base
named College using MySQL. Use below attribute to connect
with MYSQL.
host="localhost"
user ="root"
passwd =" w
Step 2: Use Database_python.py file and add the code to
create table student using the below structure given in figure 1.
Field | Type
| Null
NAME | varchar(20) | NO
BRANCH | varchar(50) | YES
ROLL | int
NO
SECTION | varchar(5) | YES
| YES
AGE
I int
Figure1: student Table
Step 3. Insert the below records (Figure 2) into student table
NAME
| BRANCH | ROLL | SECTION | AGE
|
Ram ICSE | 85 B
Nikhil | CSE
|
98 A
Nisha | CSE
Rohan | MAE
Amit | ECE
Anil
Megha I ECE
| MAE
Sita
| CSE
|
|
|
|
99
43
A
B
24
A
45
B
55 | A
95 | A
|
|
|
19
18
18
20
21
20
22
19
Figure 2: Student Records
Step 4. Display fields Name and section from student table
using print statement as given Figure 3.
('Nikhil', 'A')
('Nisha', 'A')
('Rohan', 'B')
('Amit', 'A')
('Anil', 'B')
('Megha', 'A')
('Sita', 'A')
Figure 3: Name and Section display
Transcribed Image Text:Task Specification: Step 1. Assume that MySQL connector is already installed. If not use pip3 install mysql-connector-python to install mysql-connector. After doing so, Create Data base named College using MySQL. Use below attribute to connect with MYSQL. host="localhost" user ="root" passwd =" w Step 2: Use Database_python.py file and add the code to create table student using the below structure given in figure 1. Field | Type | Null NAME | varchar(20) | NO BRANCH | varchar(50) | YES ROLL | int NO SECTION | varchar(5) | YES | YES AGE I int Figure1: student Table Step 3. Insert the below records (Figure 2) into student table NAME | BRANCH | ROLL | SECTION | AGE | Ram ICSE | 85 B Nikhil | CSE | 98 A Nisha | CSE Rohan | MAE Amit | ECE Anil Megha I ECE | MAE Sita | CSE | | | | 99 43 A B 24 A 45 B 55 | A 95 | A | | | 19 18 18 20 21 20 22 19 Figure 2: Student Records Step 4. Display fields Name and section from student table using print statement as given Figure 3. ('Nikhil', 'A') ('Nisha', 'A') ('Rohan', 'B') ('Amit', 'A') ('Anil', 'B') ('Megha', 'A') ('Sita', 'A') Figure 3: Name and Section display
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Dictionary
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.
Similar questions
  • SEE MORE 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