0% found this document useful (0 votes)
3 views

Assignment-4 python

The document provides an overview of MySQL, detailing its purpose as a relational database management system, key features, and various use cases across industries. It also explains different types of SQL commands, including DDL, DML, DCL, and TCL, and outlines basic operations such as creating, reading, updating, and deleting records in a database. Additionally, it includes practical examples for creating a 'students' table and performing various SQL operations on it.

Uploaded by

chiragkaushal10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Assignment-4 python

The document provides an overview of MySQL, detailing its purpose as a relational database management system, key features, and various use cases across industries. It also explains different types of SQL commands, including DDL, DML, DCL, and TCL, and outlines basic operations such as creating, reading, updating, and deleting records in a database. Additionally, it includes practical examples for creating a 'students' table and performing various SQL operations on it.

Uploaded by

chiragkaushal10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Assignment–4

Name – Sidharth Verma

1. What is MySQL?
a. Explain its purpose, key features, and use cases in
database management.

Ans. My SQL is a popular open source relational database


management system(RDBMS). MySQL is used to stores data in rows
and columns. It's used to store information that can be accessed
later, such as when someone logs into an account or completes a
transaction.
(a). Purpose:-
It allows you to store, manage and retrieve data in a
structured and organized way.
Key Features:-
. Open source
. Scalability
. Relational database
. Quick and Reliable
. High Performance
Use cases of MySQL:-
MySQL has many advantages because it has its foot in many
industries and various use cases across the globe. The importance of
MySQL doesn't depend only on how much data you have, it's rather
what you are going to do with the data. Data can be sourced and
analyzed from unpredictable sources and can be used to address
many things.

The preceding figure helps us understand where MySQL is serving


various industries.
2. What are SQL Commands?
a. Briefly describe the different types of SQL commands,
such as DDL, DML, DCL, and TCL.
Ans. The five basic SQL commands are SELECT, INSERT, UPDATE,
DELETE, and CREATE. These commands allow users to retrieve, add,
modify, remove, and define database structures.

(a). Different types of SQL commands are as follows:-

. DDL(Data Definition Language):-


DDL refers to the set of SQL
commands that can create and manipulate the structures of a
database. DDL statements are used to create, change, and remove
objects.

. DML(Data Manipulation Language):-


It is a collection of
programming languages that allow users to modify data in a
database.

. DCL(Data Control Language):-


It is a syntax used to control access to
data stored in a database.
. TCL(Transaction Control Language):-
TCL is a set of commands
used to manage transactions in a database management system.
3. Create Operation
a. Basic Table Creation: Create a table students with the following
fields: id, name, age, grade, and city. Specify appropriate data types
and constraints.
b. Insert Records: Insert at least 7 records into the students table.
Use both INSERT INTO with all columns specified and with selected
columns specified.

Program:
4. Read Operation
a. Basic SELECT Query: Write a query to fetch all records
from the students table.
b. Filtering Data: Retrieve all students who are 18 years
or older.
Program:
5. Update Operation
a. Updating Records: Update the city field for students from
city='Mumbai' to city='Delhi'.
b. Conditional Update: Increase the age of all students in
grade 'B' by 1 year.
c. Batch Update: Update the grade of students based on the
following conditions:
d. Set grade='A' for students with age > 20.
e. Set grade='B' for students with age <= 20.
6. Delete Operation
a. Deleting Specific Rows: Delete all students whose age is
below 20.
b. Deleting All Rows: Write a query to delete all rows from
the students table but keep the table structure intact.

Program:
(a).

(b).

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy