SlideShare una empresa de Scribd logo
1 de 32
SQL Server -  Design and Implementation
[object Object],[object Object],[object Object],An Overview of SQL
[object Object],[object Object],[object Object],[object Object],SQL is used for:
[object Object],[object Object],[object Object],SQL Requirements
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],SQL is a Relational Database A Fully Relational Database Management System must:
[object Object],[object Object],[object Object],Design
Basic structure of an SQL query
Table Design Rows describe the Occurrence of an Entity Columns describe one characteristic of the entity Tables are the basic structure where data is stored in the database. Name Address Jane Doe 123 Main Street John Smith 456 Second Street Mary Poe 789 Third Ave
SQL Constraints ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Not Null ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Default For example, if we create a table as below: CREATE TABLE Student  (Student_ID integer Unique,  Last_Name varchar (30),  First_Name varchar (30),  Score DEFAULT 80); and execute the following SQL statement, INSERT INTO Student (Student_ID, Last_Name, First_Name) values ('10','Johnson','Rick'); The table will look like the following: Even though we didn't specify a value for the "Score" column in the INSERT INTO statement, it does get assigned the default value of 80 since we had already set 80 as the default value for  this column. Student_ID Last_Name First_Name Score 10 Johnson Rick 80
Unique For example, in the following CREATE TABLE statement, CREATE TABLE Customer (SID integer Unique, Last_Name varchar (30),  First_Name varchar(30)); column "SID" has a unique constraint, and hence cannot include duplicate values.  Such constraint does not hold for columns "Last_Name" and "First_Name".  So, if the table already contains the following rows: Executing the following SQL statement, INSERT INTO Customer values ('3','Lee','Grace'); will result in an error because '3' already exists in the SID column, thus trying to insert  another row with that value violates the UNIQUE constraint. SID Last_Name First_Name 1 Johnson Stella 2 James Gina 3 Aaron Ralph
Check ,[object Object],[object Object],[object Object],[object Object],[object Object]
Primary Key A primary key is used to uniquely identify each row in a table. A primary key can consist of one or more fields on a table. When multiple fields are used as a primary key, they are called a composite key. CREATE TABLE Customer  (SID integer PRIMARY KEY,  Last_Name varchar(30),  First_Name varchar(30));
Foreign Key A foreign key is a field (or fields) that points to the primary key of another table. The purpose of the foreign key is, only values that are supposed to appear in the database are permitted. CREATE TABLE ORDERS  (Order_ID integer primary key, Order_Date datetime,  Customer_SID integer references CUSTOMER(SID),  Amount double); In the above example, the Customer_SID column in the ORDERS table is a foreign key pointing to the SID column in the CUSTOMER table.
[object Object],Data Retrieval (Queries) SELECT SELECT * FROM publishers ,[object Object],pub_id pub_name address state 0736 New Age Books 1 1 st  Street MA 0987 Binnet & Hardley 2 2 nd  Street DC 1120 Algodata Infosys 3 3 rd  Street CA
[object Object],Data Retrieval (Queries) ,[object Object],SELECT * from publishers where state = ‘CA’ pub_id pub_name address state 0736 New Age Books 1 1 st  Street MA 0987 Binnet & Hardley 2 2 nd  Street DC 1120 Algodata Infosys 3 3 rd  Street CA
[object Object],Data Input INSERT  ,[object Object],INSERT INTO publishers VALUES (‘0010’, ‘pragmatics’, ‘4 4 th  Ln’, ‘chicago’, ‘il’) Keyword Variable pub_id pub_name address state 0736 New Age Books 1 1 st  Street MA 0987 Binnet & Hardley 2 2 nd  Street DC 1120 Algodata Infosys 3 3 rd  Street CA pub_id pub_name address state 0010 Pragmatics 4 4 th  Ln IL 0736 New Age Books 1 1 st  Street MA 0987 Binnet & Hardley 2 2 nd  Street DC 1120 Algodata Infosys 3 3 rd  Street CA
[object Object],[object Object],Types of Tables There are two types of tables which make up a relational database in SQL pub_id pub_name address state 0010 Pragmatics 4 4 th  Ln IL 0736 New Age Books 1 1 st  Street MA 0987 Binnet & Hardley 2 2 nd  Street DC 1120 Algodata Infosys 3 3 rd  Street CA
Using SQL SQL statements can be embedded into a program (cgi or perl script, Visual Basic, C#, MS Access) OR SQL statements can be entered directly at the command prompt of the SQL software being used (such as mySQL)
Using SQL To begin, you must first CREATE a database using the following SQL statement: CREATE DATABASE database_name Depending on the version of SQL being used the following statement is needed to begin using the database: USE database_name
[object Object],Using SQL CREATE TABLE authors (auth_id int(9) not null, auth_name char(40) not null) auth_id auth_name (9 digit int) (40 char string)
[object Object],Using SQL ,[object Object],SELECT * FROM authors INSERT INTO authors values(‘000000001’, ‘John Smith’) 000000001 John Smith auth_id auth_name
Using SQL SELECT auth_name, auth_city FROM publishers If you only want to display the author’s name and city from the following table: auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI auth_name auth_city Jane Doe Dearborn John Smith Taylor
Using SQL DELETE from authors WHERE auth_name=‘John Smith’ To delete data from a table, use the DELETE statement: auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI
Using SQL UPDATE authors SET auth_name=‘hello’ To Update information in a database use the UPDATE keyword Hello Hello Sets all auth_name fields to hello auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI
Using SQL ALTER TABLE authors ADD birth_date datetime null To change a table in a database use ALTER TABLE.  ADD adds a characteristic. ADD puts a new column in the table called birth_date Type Initializer auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI birth_date . .
Using SQL ALTER TABLE authors DROP birth_date To delete a column or row, use the keyword DROP DROP removed the birth_date characteristic from the table auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI auth_state . .
Using SQL DROP DATABASE authors The DROP statement is also used to delete an entire database. DROP removed the database and returned the memory to system auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI
Normalization The process of removing redundant data by creating relations between tables is known as Normalization. Normalization process uses formal methods to design the database in interrelated tables.
Design DB
[object Object],[object Object],[object Object],Conclusion

Más contenido relacionado

La actualidad más candente (20)

Ms sql server ii
Ms sql server  iiMs sql server  ii
Ms sql server ii
 
Query
QueryQuery
Query
 
Chapter 07 ddl_sql
Chapter 07 ddl_sqlChapter 07 ddl_sql
Chapter 07 ddl_sql
 
MY SQL
MY SQLMY SQL
MY SQL
 
Database testing
Database testingDatabase testing
Database testing
 
Sq lite module7
Sq lite module7Sq lite module7
Sq lite module7
 
Sql
SqlSql
Sql
 
SQL Tutorial for BCA-2
SQL Tutorial for BCA-2SQL Tutorial for BCA-2
SQL Tutorial for BCA-2
 
BIS05 Introduction to SQL
BIS05 Introduction to SQLBIS05 Introduction to SQL
BIS05 Introduction to SQL
 
SQL
SQLSQL
SQL
 
Ankit
AnkitAnkit
Ankit
 
SImple SQL
SImple SQLSImple SQL
SImple SQL
 
SQL report
SQL reportSQL report
SQL report
 
Introduction to sq lite
Introduction to sq liteIntroduction to sq lite
Introduction to sq lite
 
Sql slid
Sql slidSql slid
Sql slid
 
Avinash database
Avinash databaseAvinash database
Avinash database
 
Intro to tsql unit 7
Intro to tsql   unit 7Intro to tsql   unit 7
Intro to tsql unit 7
 
Select To Order By
Select  To  Order BySelect  To  Order By
Select To Order By
 
Assignment#02
Assignment#02Assignment#02
Assignment#02
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 

Destacado

Irregular verbs, ingles iii
Irregular verbs, ingles iiiIrregular verbs, ingles iii
Irregular verbs, ingles iiiHome
 
Giana's Full Draft
Giana's Full DraftGiana's Full Draft
Giana's Full DraftGianaAnselmo
 
Purchase decision process
Purchase decision processPurchase decision process
Purchase decision processrkuchta
 
Gwtip 2011 slide show
Gwtip 2011 slide showGwtip 2011 slide show
Gwtip 2011 slide showgwvirginia
 
Budowa RESTowego api w oparciu o HATEOAS
Budowa RESTowego api w oparciu o HATEOASBudowa RESTowego api w oparciu o HATEOAS
Budowa RESTowego api w oparciu o HATEOASMateusz Stępniak
 
Inotrópicos 2016-2
Inotrópicos 2016-2Inotrópicos 2016-2
Inotrópicos 2016-2David Perez
 
bahagian b penulisan
bahagian b   penulisanbahagian b   penulisan
bahagian b penulisanMohd Amri
 
Aerospace & Defense Manufacturing in Tijuana, Mexico - White Paper 2013
Aerospace & Defense Manufacturing in Tijuana, Mexico - White Paper 2013Aerospace & Defense Manufacturing in Tijuana, Mexico - White Paper 2013
Aerospace & Defense Manufacturing in Tijuana, Mexico - White Paper 2013Kate Reifers
 
Budowa poprawnego i intuicyjnego api REST HATEOAS devfest@2013
Budowa poprawnego i intuicyjnego api REST HATEOAS devfest@2013Budowa poprawnego i intuicyjnego api REST HATEOAS devfest@2013
Budowa poprawnego i intuicyjnego api REST HATEOAS devfest@2013Mateusz Stępniak
 

Destacado (11)

Irregular verbs, ingles iii
Irregular verbs, ingles iiiIrregular verbs, ingles iii
Irregular verbs, ingles iii
 
Giana's Full Draft
Giana's Full DraftGiana's Full Draft
Giana's Full Draft
 
Purchase decision process
Purchase decision processPurchase decision process
Purchase decision process
 
Gwtip 2011 slide show
Gwtip 2011 slide showGwtip 2011 slide show
Gwtip 2011 slide show
 
Budowa RESTowego api w oparciu o HATEOAS
Budowa RESTowego api w oparciu o HATEOASBudowa RESTowego api w oparciu o HATEOAS
Budowa RESTowego api w oparciu o HATEOAS
 
Inotrópicos 2016-2
Inotrópicos 2016-2Inotrópicos 2016-2
Inotrópicos 2016-2
 
bahagian b penulisan
bahagian b   penulisanbahagian b   penulisan
bahagian b penulisan
 
Modulo metodos probabilisticos-2013 (2)
Modulo metodos probabilisticos-2013 (2)Modulo metodos probabilisticos-2013 (2)
Modulo metodos probabilisticos-2013 (2)
 
Aerospace & Defense Manufacturing in Tijuana, Mexico - White Paper 2013
Aerospace & Defense Manufacturing in Tijuana, Mexico - White Paper 2013Aerospace & Defense Manufacturing in Tijuana, Mexico - White Paper 2013
Aerospace & Defense Manufacturing in Tijuana, Mexico - White Paper 2013
 
Budowa poprawnego i intuicyjnego api REST HATEOAS devfest@2013
Budowa poprawnego i intuicyjnego api REST HATEOAS devfest@2013Budowa poprawnego i intuicyjnego api REST HATEOAS devfest@2013
Budowa poprawnego i intuicyjnego api REST HATEOAS devfest@2013
 
afsfdsdf
afsfdsdfafsfdsdf
afsfdsdf
 

Similar a Sql

Creating database using sql commands
Creating database using sql commandsCreating database using sql commands
Creating database using sql commandsBelle Wx
 
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
 
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDSORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDSNewyorksys.com
 
Sql – Structured Query Language
Sql – Structured Query LanguageSql – Structured Query Language
Sql – Structured Query Languagepandey3045_bit
 
SQL Beginners anishurrehman.cloud.pdf
SQL Beginners anishurrehman.cloud.pdfSQL Beginners anishurrehman.cloud.pdf
SQL Beginners anishurrehman.cloud.pdfAnishurRehman1
 
Database development coding standards
Database development coding standardsDatabase development coding standards
Database development coding standardsAlessandro Baratella
 
Entigrity constraint
Entigrity constraintEntigrity constraint
Entigrity constraintsuman kumar
 

Similar a Sql (20)

Creating database using sql commands
Creating database using sql commandsCreating database using sql commands
Creating database using sql commands
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
Sql 2006
Sql 2006Sql 2006
Sql 2006
 
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...
 
chapter 8 SQL.ppt
chapter 8 SQL.pptchapter 8 SQL.ppt
chapter 8 SQL.ppt
 
Sql wksht-2
Sql wksht-2Sql wksht-2
Sql wksht-2
 
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDSORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
 
Sql – Structured Query Language
Sql – Structured Query LanguageSql – Structured Query Language
Sql – Structured Query Language
 
Module 3
Module 3Module 3
Module 3
 
Sql commands
Sql commandsSql commands
Sql commands
 
Sql
SqlSql
Sql
 
SQL Beginners anishurrehman.cloud.pdf
SQL Beginners anishurrehman.cloud.pdfSQL Beginners anishurrehman.cloud.pdf
SQL Beginners anishurrehman.cloud.pdf
 
SQL
SQLSQL
SQL
 
SQL
SQLSQL
SQL
 
Database development coding standards
Database development coding standardsDatabase development coding standards
Database development coding standards
 
Entigrity constraint
Entigrity constraintEntigrity constraint
Entigrity constraint
 
SQL.ppt
SQL.pptSQL.ppt
SQL.ppt
 
Chap 7
Chap 7Chap 7
Chap 7
 
Lab
LabLab
Lab
 
Db1 lecture4
Db1 lecture4Db1 lecture4
Db1 lecture4
 

Último

THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 

Último (20)

THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 

Sql

  • 1. SQL Server - Design and Implementation
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. Basic structure of an SQL query
  • 8. Table Design Rows describe the Occurrence of an Entity Columns describe one characteristic of the entity Tables are the basic structure where data is stored in the database. Name Address Jane Doe 123 Main Street John Smith 456 Second Street Mary Poe 789 Third Ave
  • 9.
  • 10.
  • 11. Default For example, if we create a table as below: CREATE TABLE Student  (Student_ID integer Unique,  Last_Name varchar (30),  First_Name varchar (30),  Score DEFAULT 80); and execute the following SQL statement, INSERT INTO Student (Student_ID, Last_Name, First_Name) values ('10','Johnson','Rick'); The table will look like the following: Even though we didn't specify a value for the "Score" column in the INSERT INTO statement, it does get assigned the default value of 80 since we had already set 80 as the default value for this column. Student_ID Last_Name First_Name Score 10 Johnson Rick 80
  • 12. Unique For example, in the following CREATE TABLE statement, CREATE TABLE Customer (SID integer Unique, Last_Name varchar (30),  First_Name varchar(30)); column "SID" has a unique constraint, and hence cannot include duplicate values. Such constraint does not hold for columns "Last_Name" and "First_Name". So, if the table already contains the following rows: Executing the following SQL statement, INSERT INTO Customer values ('3','Lee','Grace'); will result in an error because '3' already exists in the SID column, thus trying to insert another row with that value violates the UNIQUE constraint. SID Last_Name First_Name 1 Johnson Stella 2 James Gina 3 Aaron Ralph
  • 13.
  • 14. Primary Key A primary key is used to uniquely identify each row in a table. A primary key can consist of one or more fields on a table. When multiple fields are used as a primary key, they are called a composite key. CREATE TABLE Customer  (SID integer PRIMARY KEY,  Last_Name varchar(30),  First_Name varchar(30));
  • 15. Foreign Key A foreign key is a field (or fields) that points to the primary key of another table. The purpose of the foreign key is, only values that are supposed to appear in the database are permitted. CREATE TABLE ORDERS  (Order_ID integer primary key, Order_Date datetime,  Customer_SID integer references CUSTOMER(SID),  Amount double); In the above example, the Customer_SID column in the ORDERS table is a foreign key pointing to the SID column in the CUSTOMER table.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. Using SQL SQL statements can be embedded into a program (cgi or perl script, Visual Basic, C#, MS Access) OR SQL statements can be entered directly at the command prompt of the SQL software being used (such as mySQL)
  • 21. Using SQL To begin, you must first CREATE a database using the following SQL statement: CREATE DATABASE database_name Depending on the version of SQL being used the following statement is needed to begin using the database: USE database_name
  • 22.
  • 23.
  • 24. Using SQL SELECT auth_name, auth_city FROM publishers If you only want to display the author’s name and city from the following table: auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI auth_name auth_city Jane Doe Dearborn John Smith Taylor
  • 25. Using SQL DELETE from authors WHERE auth_name=‘John Smith’ To delete data from a table, use the DELETE statement: auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI
  • 26. Using SQL UPDATE authors SET auth_name=‘hello’ To Update information in a database use the UPDATE keyword Hello Hello Sets all auth_name fields to hello auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI
  • 27. Using SQL ALTER TABLE authors ADD birth_date datetime null To change a table in a database use ALTER TABLE. ADD adds a characteristic. ADD puts a new column in the table called birth_date Type Initializer auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI birth_date . .
  • 28. Using SQL ALTER TABLE authors DROP birth_date To delete a column or row, use the keyword DROP DROP removed the birth_date characteristic from the table auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI auth_state . .
  • 29. Using SQL DROP DATABASE authors The DROP statement is also used to delete an entire database. DROP removed the database and returned the memory to system auth_id auth_name auth_city auth_state 123456789 Jane Doe Dearborn MI 000000001 John Smith Taylor MI
  • 30. Normalization The process of removing redundant data by creating relations between tables is known as Normalization. Normalization process uses formal methods to design the database in interrelated tables.
  • 32.

Notas del editor

  1. Frequently, presenters must deliver material of a technical nature to an audience unfamiliar with the topic or vocabulary. The material may be complex or heavy with detail. To present technical material effectively, use the following guidelines from Dale Carnegie Training®.   Consider the amount of time available and prepare to organize your material. Narrow your topic. Divide your presentation into clear segments. Follow a logical progression. Maintain your focus throughout. Close the presentation with a summary, repetition of the key steps, or a logical conclusion.   Keep your audience in mind at all times. For example, be sure data is clear and information is relevant. Keep the level of detail and vocabulary appropriate for the audience. Use visuals to support key points or steps. Keep alert to the needs of your listeners, and you will have a more receptive audience.
  2. In your opening, establish the relevancy of the topic to the audience. Give a brief preview of the presentation and establish value for the listeners. Take into account your audience’s interest and expertise in the topic when choosing your vocabulary, examples, and illustrations. Focus on the importance of the topic to your audience, and you will have more attentive listeners.
  3. If you have several points, steps, or key ideas use multiple slides. Determine if your audience is to understand a new idea, learn a process, or receive greater depth to a familiar concept. Back up each point with adequate explanation. As appropriate, supplement your presentation with technical support data in hard copy or on disc, e-mail, or the Internet. Develop each point adequately to communicate with your audience.
  4. In your opening, establish the relevancy of the topic to the audience. Give a brief preview of the presentation and establish value for the listeners. Take into account your audience’s interest and expertise in the topic when choosing your vocabulary, examples, and illustrations. Focus on the importance of the topic to your audience, and you will have more attentive listeners.
  5. If you have several points, steps, or key ideas use multiple slides. Determine if your audience is to understand a new idea, learn a process, or receive greater depth to a familiar concept. Back up each point with adequate explanation. As appropriate, supplement your presentation with technical support data in hard copy or on disc, e-mail, or the Internet. Develop each point adequately to communicate with your audience.
  6. If you have several points, steps, or key ideas use multiple slides. Determine if your audience is to understand a new idea, learn a process, or receive greater depth to a familiar concept. Back up each point with adequate explanation. As appropriate, supplement your presentation with technical support data in hard copy or on disc, e-mail, or the Internet. Develop each point adequately to communicate with your audience.
  7. If you have several points, steps, or key ideas use multiple slides. Determine if your audience is to understand a new idea, learn a process, or receive greater depth to a familiar concept. Back up each point with adequate explanation. As appropriate, supplement your presentation with technical support data in hard copy or on disc, e-mail, or the Internet. Develop each point adequately to communicate with your audience.
  8. If you have several points, steps, or key ideas use multiple slides. Determine if your audience is to understand a new idea, learn a process, or receive greater depth to a familiar concept. Back up each point with adequate explanation. As appropriate, supplement your presentation with technical support data in hard copy or on disc, e-mail, or the Internet. Develop each point adequately to communicate with your audience.
  9. If you have several points, steps, or key ideas use multiple slides. Determine if your audience is to understand a new idea, learn a process, or receive greater depth to a familiar concept. Back up each point with adequate explanation. As appropriate, supplement your presentation with technical support data in hard copy or on disc, e-mail, or the Internet. Develop each point adequately to communicate with your audience.
  10. If you have several points, steps, or key ideas use multiple slides. Determine if your audience is to understand a new idea, learn a process, or receive greater depth to a familiar concept. Back up each point with adequate explanation. As appropriate, supplement your presentation with technical support data in hard copy or on disc, e-mail, or the Internet. Develop each point adequately to communicate with your audience.
  11. If you have several points, steps, or key ideas use multiple slides. Determine if your audience is to understand a new idea, learn a process, or receive greater depth to a familiar concept. Back up each point with adequate explanation. As appropriate, supplement your presentation with technical support data in hard copy or on disc, e-mail, or the Internet. Develop each point adequately to communicate with your audience.
  12. If you have several points, steps, or key ideas use multiple slides. Determine if your audience is to understand a new idea, learn a process, or receive greater depth to a familiar concept. Back up each point with adequate explanation. As appropriate, supplement your presentation with technical support data in hard copy or on disc, e-mail, or the Internet. Develop each point adequately to communicate with your audience.
  13. If you have several points, steps, or key ideas use multiple slides. Determine if your audience is to understand a new idea, learn a process, or receive greater depth to a familiar concept. Back up each point with adequate explanation. As appropriate, supplement your presentation with technical support data in hard copy or on disc, e-mail, or the Internet. Develop each point adequately to communicate with your audience.
  14. Determine the best close for your audience and your presentation. Close with a summary; offer options; recommend a strategy; suggest a plan; set a goal. Keep your focus throughout your presentation, and you will more likely achieve your purpose.