100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Résumé Cours SQL $7.03   Add to cart

Summary

Résumé Cours SQL

 1 view  0 purchase
  • Course
  • Institution

Toutes les commandes sql avec exemple d'application, sans trop de blabla

Preview 3 out of 18  pages

  • March 1, 2023
  • 18
  • 2022/2023
  • Summary
avatar-seller
Cours SQL
SQL est un langage standardisé, implémenté par tous les SGBDR, qui permet de définir le modèle de
manipuler.


Qu’appelle-t-on SGBDR ?
Un système de gestion de BD relationnelles (SGBDR) est un logiciel standard qui repose sur les princ
SGBDR propose les trois principales fonctions suivantes :

la définition des données sous forme de relations ;

la manipulation des données par un langage déclaratif ;

l’administration des données.




Catégories de commandes SQL




COMMANDE DDL
CREATE:
Exercice /q1

, #MEILLEURE SYNTAXE parce qu'on nomme les contraintes et qu'on peut y revenir plus tard.
CREATE TABLE voiture (
No number(4) not null,
marque varchar2(20) not null,
model varchar(20) not null,
annee number(4) not null,
anciennete varchar2(30) not null,
couleur varchar2(20),
kilomètres number(5),
constraint check_kilomètres check (kilomètres<=25000),
constraint check_marque check (marque in ('HONDA','TOYOTA','NISSAN')),
constraint pk_voiture primary key (No)
);




DROP:

drop table voiture;




Remarque:


delete table voiture; #Pour supprimer les lignes d'une table sans détruire la table.




ALTER:

ALTER TABLE table_name ADD column_name column_definition;
ALTER TABLE table_name MODIFY column_name column_type;
ALTER TABLE table_name DROP COLUMN column_name;
ALTER TABLE table_name RENAME COLUMN old_name TO new_name;




Remarque:


desc voiture; #Description de la table

, alter table voiture add proprietaire varchar2(30) not null




alter table voiture drop column proprietaire;




alter table voiture rename to v; #Modifier le nom de la table
desc v;

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller ryma1. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $7.03. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

60281 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$7.03
  • (0)
  Add to cart