examples
|
|
$query = 'SELECT `first` , `last` FROM `a_database` ORDER BY
`id` ';
|
ist select the two columns with
headeer names, to display in ascending order
|
$query = 'SELECT `first` , `last` FROM `a_database` WHERE
`id`<5 ORDER BY `id` ';
|
select two columns with header names , to display it hase to
pass condtion, which has id is less than 5, that’s display, in an ascending
order its display ascending order of id
|
$query = "SELECT `name` FROM `foods` WHERE `type` = '$fv'
";
|
type is column header name, select name column header and to
display it matched with fv, which one
has matched that rows onl display , from customer
|
$query = "SELECT `hits` FROM `hits_count` WHERE `id` = 1
";
|
select hits column to display it hase to pass condtion, its
display only 1 id row
|
$query = "SELECT `ip` FROM `hits_ipaddress`";
|
display ip column
|
$query = "SELECT `ip` FROM `hits_ipaddress`";
|
display ip column from database
|
$query = "SELECT `ip` FROM `hits_ipaddress`";
|
|
$query = "SELECT `hits` FROM `hits_count` WHERE `id` = 1
";
|
select hits column header to display it passs condtion means It
display only one row
|
$query = "SELECT `name` FROM `foods` WHERE `name` LIKE
'%$s_text%' ";
|
|
$query = "SELECT `id` FROM `users` WHERE `username` =
'$username' AND `password` = '$pass_hash' ";
|
|
$query = "SELECT `$field` FROM `users` WHERE `id` = '$id'
";
|
|
$query =" SELECT `username` FROM `users` WHERE `username` =
'$username'";
|
|
SELECT `id` FROM `users` WHERE `username` = '' or ''='' AND
`password` = '' or ''=''
|
|
$query = "SELECT `email` FROM `users` WHERE `id`
=$id";
|
|
$query = "SELECT `email` FROM `users` WHERE `id`
=$id";
|
|
SQL can execute queries against a database
|
|
SQL can retrieve data from a database
|
|
SQL can insert records in a database
|
|
SQL can update records in a database
|
|
SQL can delete records from a database
|
|
SQL can create new databases
|
|
SQL can create new tables in a database
|
|
SQL can create stored procedures in a database
|
|
SQL can create views in a database
|
|
SQL can set permissions on tables, procedures, and views
|
|
SELECT - extracts data from a
database
|
SELECT * FROM Customers;
|
UPDATE - updates data in a database
|
update database1.studentinfo SET firstname ='raju', age =35
where name =1;
|
DELETE - deletes data from a
database
|
delete from dummy.studentinfo where name=4;
|
INSERT INTO - inserts new data into a
database
|
|
CREATE DATABASE - creates a new database
|
|
ALTER DATABASE - modifies a database
|
|
CREATE TABLE - creates a new table
|
|
ALTER TABLE - modifies a table
|
|
DROP TABLE - deletes a table
|
drop table dummy.studentinfo;
|
CREATE INDEX - creates an index (search
key)
|
|
DROP INDEX - deletes an index
|
|
sytax select
|
|
SELECT column1, column2, ...
|
|
FROM table_name;
|
| sql hosting |
| The most common SQL hosting databases are MS SQL Server, Oracle, MySQL, and MS Access. |
No comments:
Post a Comment