Rabu, 22 November 2023

SQL Queries Command

SELECT * FROM table_name;
If you want to display all the attributes from a particular table, this is the right query to use:

SELECT column_name, ... FROM table;
If you want to display particular attributes from a particular table, this is the right query to use:

DROP VIEW view_name;
This query will delete a view. Remember that the DROP VIEW is disallowed if there are any views dependent on the view you are about to drop.

UPDATE Command Purpose

Update the values of two columns.

Update Command Syntax

UPDATE table_name SET Column_1=<value_1>, Column_2='value_2', ...;

Update Command Example

UPDATE table_name SET Column_1=1, Column_2='value_2', ...;

CREATE TABLE Command Syntax

CREATE TABLE table ( field_1 int, field_2 varchar(80), .... );

add the table and some of the column labels.

CREATE VIEW view_name AS SELECT column_1, column_2, ... FROM table_name;
Create a view that can be used to query data from table1.

INSERT INTO table_name ( column_1, column_2, ... ) VALUES ( value_1, value_2, ... );
to add new rows of data into a table in the database.


< Previous DDL, DQL, DML, DCL and TCL Commands


Bibliography:

https://bytescout.com/
https://www.tutorialspoint.com/

Tidak ada komentar:

Posting Komentar

Various Other Posts