SlideShare a Scribd company logo
1 of 14
MySQL
LABORATORY
Creating Database
To create a new database using MySQL, you can
use the CREATE DATABASE statement. Here's the
basic syntax for creating a database:
CREATE DATABASE database_name;
• database_name: This is the name you want to
give to your new database.
Creating a Table
To create a table in a MySQL database, you can use the CREATE
TABLE statement. This statement allows you to define the table's
structure, including its columns and their data types. Here's the basic
syntax for creating a table:
CREATE TABLE table_name (
column1 datatype constraints,
column2 datatype constraints,
...
);
• table_name: This is the name you want to give to your new table.
• column1, column2, ...: These are the names of the columns in the
table.
• datatype: Specifies the data type for each column (e.g., INT,
VARCHAR, DATE, etc.).
• constraints: Optional constraints, such as PRIMARY KEY, NOT
NULL, UNIQUE, AUTO_INCREMENT, and more, that define rules
for each column.
CREATE TABLE users (
user_id INT PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(50) NOT NULL,
email VARCHAR(100) UNIQUE,
birthdate DATE
);
In this example, we create a table named "users" with columns for
user ID, username, email, and birthdate. We've specified some
common constraints like PRIMARY KEY, NOT NULL, and UNIQUE to
enforce data integrity rules.
Inserting Rows into a Table
To insert rows (records) into a table in a MySQL database, you can use
the INSERT INTO statement. This statement allows you to specify the
values you want to insert into the columns of the table. Here's the basic
syntax:
INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);
• table_name: This is the name of the table into which you want to
insert data.
• (column1, column2, column3, ...): This is an optional list of column
names where you want to insert data. If you omit this part, you
should provide values for all columns in the same order they are
defined in the table.
• VALUES (value1, value2, value3, ...): This is where you specify the
values you want to insert into the corresponding columns. The
number of values should match the number of columns you're
inserting into.
INSERT INTO users (username, email, birthdate)
VALUES ('john_doe', 'john@example.com', '1990-05-15’);
In this example, we're inserting data into the "users" table, specifying
values for the "username," "email," and "birthdate" columns.
Updating and Deleting Data into a Table
In MySQL, you can use the UPDATE and DELETE statements to
modify or remove data from a table. Here's how to use each of these
statements:
Updating Data with the UPDATE Statement:
The UPDATE statement is used to modify existing records in a table.
You specify which rows to update and the new values for the columns.
The basic syntax is as follows:
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
WHERE condition: This is an optional condition that specifies which
rows to update. If omitted, all rows in the table will be updated.
UPDATE users
SET email = 'new_email@example.com'
WHERE username = 'john_doe’;
This query updates the email address for the user with the username
"john_doe."
Deleting Data with the DELETE Statement:
The DELETE statement is used to remove rows from a table based on
specified conditions. The basic syntax is as follows:
DELETE FROM table_name
WHERE condition;
WHERE condition: This is the condition that specifies which rows to
delete. If omitted, all rows in the table will be deleted.
DELETE FROM users
WHERE username = 'john_doe’;
This query deletes the user with the username "john_doe" from the
table.
ACTIVITY TIME!!!
Create a Database using MySQL and do the following:

More Related Content

Similar to ADV PPT 2 LAB.pptx

Mysql 120831075600-phpapp01
Mysql 120831075600-phpapp01Mysql 120831075600-phpapp01
Mysql 120831075600-phpapp01sagaroceanic11
 
SQL Tutorial for Beginners
SQL Tutorial for BeginnersSQL Tutorial for Beginners
SQL Tutorial for BeginnersAbdelhay Shafi
 
SQL Server Learning Drive
SQL Server Learning Drive SQL Server Learning Drive
SQL Server Learning Drive TechandMate
 
MySQL.pptx comuterscience from kvsbbsrs.
MySQL.pptx comuterscience from kvsbbsrs.MySQL.pptx comuterscience from kvsbbsrs.
MySQL.pptx comuterscience from kvsbbsrs.sudhasuryasnata06
 
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...SakkaravarthiS1
 
Creating database using sql commands
Creating database using sql commandsCreating database using sql commands
Creating database using sql commandsBelle Wx
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasadpaddu123
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasadpaddu123
 
Introduction to MySQL - Part 2
Introduction to MySQL - Part 2Introduction to MySQL - Part 2
Introduction to MySQL - Part 2webhostingguy
 
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQLDATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQLDev Chauhan
 
Sql basic things
Sql basic thingsSql basic things
Sql basic thingsNishil Jain
 
ADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsg
ADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsgADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsg
ADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsgzmulani8
 

Similar to ADV PPT 2 LAB.pptx (20)

Mysql 120831075600-phpapp01
Mysql 120831075600-phpapp01Mysql 120831075600-phpapp01
Mysql 120831075600-phpapp01
 
SQL Tutorial for Beginners
SQL Tutorial for BeginnersSQL Tutorial for Beginners
SQL Tutorial for Beginners
 
SQL Server Learning Drive
SQL Server Learning Drive SQL Server Learning Drive
SQL Server Learning Drive
 
1 introduction to my sql
1 introduction to my sql1 introduction to my sql
1 introduction to my sql
 
MySQL.pptx comuterscience from kvsbbsrs.
MySQL.pptx comuterscience from kvsbbsrs.MySQL.pptx comuterscience from kvsbbsrs.
MySQL.pptx comuterscience from kvsbbsrs.
 
Sql commands
Sql commandsSql commands
Sql commands
 
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
 
Module 3
Module 3Module 3
Module 3
 
Creating database using sql commands
Creating database using sql commandsCreating database using sql commands
Creating database using sql commands
 
SQL | DML
SQL | DMLSQL | DML
SQL | DML
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
 
unit-5 sql notes.docx
unit-5 sql notes.docxunit-5 sql notes.docx
unit-5 sql notes.docx
 
ADBMS Unit-II c
ADBMS Unit-II cADBMS Unit-II c
ADBMS Unit-II c
 
2..basic queries.pptx
2..basic queries.pptx2..basic queries.pptx
2..basic queries.pptx
 
Sql basics
Sql basicsSql basics
Sql basics
 
Introduction to MySQL - Part 2
Introduction to MySQL - Part 2Introduction to MySQL - Part 2
Introduction to MySQL - Part 2
 
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQLDATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
 
Sql basic things
Sql basic thingsSql basic things
Sql basic things
 
ADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsg
ADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsgADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsg
ADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsg
 

More from ArjayBalberan1

MYSQL DATABASE MYSQL DATABASEGroup-1.pptx
MYSQL DATABASE MYSQL DATABASEGroup-1.pptxMYSQL DATABASE MYSQL DATABASEGroup-1.pptx
MYSQL DATABASE MYSQL DATABASEGroup-1.pptxArjayBalberan1
 
Appdev appdev appdev app devAPPDEV 1.2.pptx
Appdev appdev appdev app devAPPDEV 1.2.pptxAppdev appdev appdev app devAPPDEV 1.2.pptx
Appdev appdev appdev app devAPPDEV 1.2.pptxArjayBalberan1
 
Rizals-Family-Childhood-Early-Education.pptx
Rizals-Family-Childhood-Early-Education.pptxRizals-Family-Childhood-Early-Education.pptx
Rizals-Family-Childhood-Early-Education.pptxArjayBalberan1
 
MYSQL DATABASE Operating System Part2 (1).pptx
MYSQL DATABASE Operating System Part2 (1).pptxMYSQL DATABASE Operating System Part2 (1).pptx
MYSQL DATABASE Operating System Part2 (1).pptxArjayBalberan1
 
MYSQL DATABASE APP DEV POWERPOINT 1.pptx
MYSQL DATABASE APP DEV POWERPOINT 1.pptxMYSQL DATABASE APP DEV POWERPOINT 1.pptx
MYSQL DATABASE APP DEV POWERPOINT 1.pptxArjayBalberan1
 
MYSQL DATABASE INTRODUCTION TO JAVASCRIPT.pptx
MYSQL DATABASE INTRODUCTION TO JAVASCRIPT.pptxMYSQL DATABASE INTRODUCTION TO JAVASCRIPT.pptx
MYSQL DATABASE INTRODUCTION TO JAVASCRIPT.pptxArjayBalberan1
 
NETWORK-TOPOLOGIES-VARIOUS-TOPOLOGIES.pptx
NETWORK-TOPOLOGIES-VARIOUS-TOPOLOGIES.pptxNETWORK-TOPOLOGIES-VARIOUS-TOPOLOGIES.pptx
NETWORK-TOPOLOGIES-VARIOUS-TOPOLOGIES.pptxArjayBalberan1
 
MYSQL DATABASE MYSQL DATABASEINSERTION-SORT.pptx
MYSQL DATABASE MYSQL DATABASEINSERTION-SORT.pptxMYSQL DATABASE MYSQL DATABASEINSERTION-SORT.pptx
MYSQL DATABASE MYSQL DATABASEINSERTION-SORT.pptxArjayBalberan1
 
MYSQL DATABASE MYSQL DATABASE merge-sort-grp4.pptx
MYSQL DATABASE MYSQL DATABASE merge-sort-grp4.pptxMYSQL DATABASE MYSQL DATABASE merge-sort-grp4.pptx
MYSQL DATABASE MYSQL DATABASE merge-sort-grp4.pptxArjayBalberan1
 
MYSQL DATABASE MYSQL DATABASE MYSQL DATABASE BUBLESORT.pptx
MYSQL DATABASE MYSQL DATABASE MYSQL DATABASE BUBLESORT.pptxMYSQL DATABASE MYSQL DATABASE MYSQL DATABASE BUBLESORT.pptx
MYSQL DATABASE MYSQL DATABASE MYSQL DATABASE BUBLESORT.pptxArjayBalberan1
 
MYSQL DATABASE MYSQL DATABASEquick-sort.pptx
MYSQL DATABASE MYSQL DATABASEquick-sort.pptxMYSQL DATABASE MYSQL DATABASEquick-sort.pptx
MYSQL DATABASE MYSQL DATABASEquick-sort.pptxArjayBalberan1
 
Selection-sort-in-algorithm and complexity.pptx
Selection-sort-in-algorithm and complexity.pptxSelection-sort-in-algorithm and complexity.pptx
Selection-sort-in-algorithm and complexity.pptxArjayBalberan1
 
Week 7 Github - SI- Architecture.pptx
Week 7 Github - SI-  Architecture.pptxWeek 7 Github - SI-  Architecture.pptx
Week 7 Github - SI- Architecture.pptxArjayBalberan1
 
Week Topic Code Access vs Event Based.pptx
Week Topic Code Access vs Event Based.pptxWeek Topic Code Access vs Event Based.pptx
Week Topic Code Access vs Event Based.pptxArjayBalberan1
 
APP DEV POWERPOINT 2.pptx
APP DEV POWERPOINT 2.pptxAPP DEV POWERPOINT 2.pptx
APP DEV POWERPOINT 2.pptxArjayBalberan1
 

More from ArjayBalberan1 (20)

MYSQL DATABASE MYSQL DATABASEGroup-1.pptx
MYSQL DATABASE MYSQL DATABASEGroup-1.pptxMYSQL DATABASE MYSQL DATABASEGroup-1.pptx
MYSQL DATABASE MYSQL DATABASEGroup-1.pptx
 
Appdev appdev appdev app devAPPDEV 1.2.pptx
Appdev appdev appdev app devAPPDEV 1.2.pptxAppdev appdev appdev app devAPPDEV 1.2.pptx
Appdev appdev appdev app devAPPDEV 1.2.pptx
 
Rizals-Family-Childhood-Early-Education.pptx
Rizals-Family-Childhood-Early-Education.pptxRizals-Family-Childhood-Early-Education.pptx
Rizals-Family-Childhood-Early-Education.pptx
 
MYSQL DATABASE Operating System Part2 (1).pptx
MYSQL DATABASE Operating System Part2 (1).pptxMYSQL DATABASE Operating System Part2 (1).pptx
MYSQL DATABASE Operating System Part2 (1).pptx
 
MYSQL DATABASE APP DEV POWERPOINT 1.pptx
MYSQL DATABASE APP DEV POWERPOINT 1.pptxMYSQL DATABASE APP DEV POWERPOINT 1.pptx
MYSQL DATABASE APP DEV POWERPOINT 1.pptx
 
MYSQL DATABASE INTRODUCTION TO JAVASCRIPT.pptx
MYSQL DATABASE INTRODUCTION TO JAVASCRIPT.pptxMYSQL DATABASE INTRODUCTION TO JAVASCRIPT.pptx
MYSQL DATABASE INTRODUCTION TO JAVASCRIPT.pptx
 
NETWORK-TOPOLOGIES-VARIOUS-TOPOLOGIES.pptx
NETWORK-TOPOLOGIES-VARIOUS-TOPOLOGIES.pptxNETWORK-TOPOLOGIES-VARIOUS-TOPOLOGIES.pptx
NETWORK-TOPOLOGIES-VARIOUS-TOPOLOGIES.pptx
 
MYSQL DATABASE MYSQL DATABASEINSERTION-SORT.pptx
MYSQL DATABASE MYSQL DATABASEINSERTION-SORT.pptxMYSQL DATABASE MYSQL DATABASEINSERTION-SORT.pptx
MYSQL DATABASE MYSQL DATABASEINSERTION-SORT.pptx
 
MYSQL DATABASE MYSQL DATABASE merge-sort-grp4.pptx
MYSQL DATABASE MYSQL DATABASE merge-sort-grp4.pptxMYSQL DATABASE MYSQL DATABASE merge-sort-grp4.pptx
MYSQL DATABASE MYSQL DATABASE merge-sort-grp4.pptx
 
MYSQL DATABASE MYSQL DATABASE MYSQL DATABASE BUBLESORT.pptx
MYSQL DATABASE MYSQL DATABASE MYSQL DATABASE BUBLESORT.pptxMYSQL DATABASE MYSQL DATABASE MYSQL DATABASE BUBLESORT.pptx
MYSQL DATABASE MYSQL DATABASE MYSQL DATABASE BUBLESORT.pptx
 
MYSQL DATABASE MYSQL DATABASEquick-sort.pptx
MYSQL DATABASE MYSQL DATABASEquick-sort.pptxMYSQL DATABASE MYSQL DATABASEquick-sort.pptx
MYSQL DATABASE MYSQL DATABASEquick-sort.pptx
 
Selection-sort-in-algorithm and complexity.pptx
Selection-sort-in-algorithm and complexity.pptxSelection-sort-in-algorithm and complexity.pptx
Selection-sort-in-algorithm and complexity.pptx
 
Week 7 Github - SI- Architecture.pptx
Week 7 Github - SI-  Architecture.pptxWeek 7 Github - SI-  Architecture.pptx
Week 7 Github - SI- Architecture.pptx
 
HTML-Lab.pptx
HTML-Lab.pptxHTML-Lab.pptx
HTML-Lab.pptx
 
tableslist.pptx
tableslist.pptxtableslist.pptx
tableslist.pptx
 
Week Topic Code Access vs Event Based.pptx
Week Topic Code Access vs Event Based.pptxWeek Topic Code Access vs Event Based.pptx
Week Topic Code Access vs Event Based.pptx
 
MODULE-01.pptx
MODULE-01.pptxMODULE-01.pptx
MODULE-01.pptx
 
APP DEV POWERPOINT 2.pptx
APP DEV POWERPOINT 2.pptxAPP DEV POWERPOINT 2.pptx
APP DEV POWERPOINT 2.pptx
 
APPDEV 1.pptx
APPDEV 1.pptxAPPDEV 1.pptx
APPDEV 1.pptx
 
ADV PPT 8 LAB.pptx
ADV PPT 8 LAB.pptxADV PPT 8 LAB.pptx
ADV PPT 8 LAB.pptx
 

Recently uploaded

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 

Recently uploaded (20)

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 

ADV PPT 2 LAB.pptx

  • 2. Creating Database To create a new database using MySQL, you can use the CREATE DATABASE statement. Here's the basic syntax for creating a database: CREATE DATABASE database_name; • database_name: This is the name you want to give to your new database.
  • 3. Creating a Table To create a table in a MySQL database, you can use the CREATE TABLE statement. This statement allows you to define the table's structure, including its columns and their data types. Here's the basic syntax for creating a table: CREATE TABLE table_name ( column1 datatype constraints, column2 datatype constraints, ... );
  • 4. • table_name: This is the name you want to give to your new table. • column1, column2, ...: These are the names of the columns in the table. • datatype: Specifies the data type for each column (e.g., INT, VARCHAR, DATE, etc.). • constraints: Optional constraints, such as PRIMARY KEY, NOT NULL, UNIQUE, AUTO_INCREMENT, and more, that define rules for each column.
  • 5. CREATE TABLE users ( user_id INT PRIMARY KEY AUTO_INCREMENT, username VARCHAR(50) NOT NULL, email VARCHAR(100) UNIQUE, birthdate DATE ); In this example, we create a table named "users" with columns for user ID, username, email, and birthdate. We've specified some common constraints like PRIMARY KEY, NOT NULL, and UNIQUE to enforce data integrity rules.
  • 6. Inserting Rows into a Table To insert rows (records) into a table in a MySQL database, you can use the INSERT INTO statement. This statement allows you to specify the values you want to insert into the columns of the table. Here's the basic syntax: INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...);
  • 7. • table_name: This is the name of the table into which you want to insert data. • (column1, column2, column3, ...): This is an optional list of column names where you want to insert data. If you omit this part, you should provide values for all columns in the same order they are defined in the table. • VALUES (value1, value2, value3, ...): This is where you specify the values you want to insert into the corresponding columns. The number of values should match the number of columns you're inserting into.
  • 8. INSERT INTO users (username, email, birthdate) VALUES ('john_doe', 'john@example.com', '1990-05-15’); In this example, we're inserting data into the "users" table, specifying values for the "username," "email," and "birthdate" columns.
  • 9. Updating and Deleting Data into a Table In MySQL, you can use the UPDATE and DELETE statements to modify or remove data from a table. Here's how to use each of these statements:
  • 10. Updating Data with the UPDATE Statement: The UPDATE statement is used to modify existing records in a table. You specify which rows to update and the new values for the columns. The basic syntax is as follows: UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE condition; WHERE condition: This is an optional condition that specifies which rows to update. If omitted, all rows in the table will be updated.
  • 11. UPDATE users SET email = 'new_email@example.com' WHERE username = 'john_doe’; This query updates the email address for the user with the username "john_doe."
  • 12. Deleting Data with the DELETE Statement: The DELETE statement is used to remove rows from a table based on specified conditions. The basic syntax is as follows: DELETE FROM table_name WHERE condition; WHERE condition: This is the condition that specifies which rows to delete. If omitted, all rows in the table will be deleted.
  • 13. DELETE FROM users WHERE username = 'john_doe’; This query deletes the user with the username "john_doe" from the table.
  • 14. ACTIVITY TIME!!! Create a Database using MySQL and do the following: