Wednesday, 23 January 2019

Commands---- create

This command is used to create a table. The syntax of this command is:
create table tablename
(column1name datatype [constraint],
column2name datatype [constraint],
column3name datatype [constraint]);
create table citylist
(name varchar(20),
state varchar(20),
population number(8),
zipcode number(5) unique);

Features/ Advantages of SQL

Stored Procedures
The one main advantage of using SQL is the use of stored procedures. Stored procedures are lines of code
that are called by the application. They are placed on the server, and they are pre-compiled for quicker
response times. Stored procedures require the knowledge of SQL Server syntax, which is called T-SQL
(transaction SQL). The use of stored procedures also centralizes code, so troubleshooting bad database
requests can be observed by a database administrator.
 Scalability

The term scalability is used to describe the ability to grow when the business becomes bigger. When
businesses grow quickly, a small database application like Access can be a bottleneck for a website or
desktop software. Microsoft SQL Server is quick for large and small businesses, so as the business grows,
the SQL Server can handle the new volume of database requests. SQL Server can handle millions of records
and transactions.
 Security

Security is a major issue for any site. SQL Server allows the administrator to grant access or deny access for
users. The SQL Server has a specific section of the application where users are added to the permissions.
SQL Server allows administrators to specify which tables and stored procedures users are able to access and
query. This limits what records and user information can be queried, which protects the business's customer
information.
 Transaction Logs
Transaction logs are objects on the SQL Server that record the retrieval, update and deletion of records.
There are two reasons to keep transaction logs. The first is for rollback procedures. This process is used for
accidental updates or deletions. The administrator can return records back to the original data by using
transaction logs. Secondly, the transaction logs can be used for security purposes. If the administrator
suspects a breach of security, he can watch the transaction logs for any type of data retrieval and identify the
severity of the breach.
 Automatic Backup
SQL Server has an automatic backup option. The SQL Server automatically saves a copy of the database
and the transaction logs on another hard drive or media like a CD-ROM or a DVD. Small applications like
Access do not have this option, and backups are an integral part of disaster recovery. SQL Server also has
procedures that allow the administrator to quickly restore a database when data is lost or corrupted, or the
server has a hard drive crash.
SQL Components
SQL consists of three components:
1. Data Definition Language (DDL)
2. Data Manipulation Language (DML)
3. Data Control Language (DCL)
The Data Definition Language (DDL). This component of the SQL language is used to create and modify
tables and other objects in the database. For tables there are three main commands:
CREATE TABLE table name to create a table in the database
DROP TABLE table name to remove a table from the database
ALTER TABLE table name to add or remove columns from a table in the database
The Data Manipulation Language (DML) component of the SQL language is used to manipulate data
within a table. There are four main commands:



SELECT to select rows of data from a table
INSERT to insert rows of data into a table
UPDATE to change rows of data in a table
DELETE to remove rows of data from a table
The Data Control Language (DCL) This component of the SQL language is used to create privileges to
allow users access to, and manipulation of, the database. There are two main commands:
GRANT to grant a privilege to a user
REVOKE to revoke (remove) a privilege from a user

Introduction of SQL


Structured Query Language (SQL) is a specialized language for updating, deleting, and requesting
information from databases. SQL is an ANSI and ISO standard, and is the de facto standard database query
language. A variety of established database products support SQL, including products from Oracle and
Microsoft SQL Server. It is widely used in both industry and academia, often for enormous, complex
databases.

In a distributed database system, a program often referred to as the database's "back end" runs constantly on
a server, interpreting data files on the server as a standard relational database. Programs on client computers
allow users to manipulate that data, using tables, columns, rows, and fields. To do this, client programs send
SQL statements to the server. The server then processes these statements and returns replies to the client
program.
SQL is a standardized query language for requesting information from a database. The original version
called SEQUEL (structured English query language) was designed by an IBM research center in 1974 and
1975. SQL was first introduced as a commercial database system in 1979 by Oracle Corporation.
Historically, SQL has been the favorite query language for database management systems running
on minicomputers and mainframes. Increasingly, however, SQL is being supported by PC database systems
because it supports distributed databases (databases that are spread out over several computer systems). This
enables several users on a local-area network to access the same database simultaneously.
 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
The most common operation in SQL is the query, which is performed with the
declarative SELECT statement. SELECT retrieves data from one or more tables, or expressions. Standard
SELECT statements have no persistent effects on the database. Some non-standard implementations
of SELECT can have persistent effects, such as the SELECT INTO syntax that exists in some databases.
Queries allow the user to describe desired data, leaving the database management system
(DBMS) responsible for planning, optimizing, and performing the physical operations necessary to produce
that result as it chooses. A query includes a list of columns to be included in the final result immediately
following the SELECT keyword. An asterisk ("*") can also be used to specify that the query should return
all columns of the queried tables. SELECT is the most complex statement in SQL, with optional keywords
and clauses that include:
 The FROM clause which indicates the table(s) from which data is to be retrieved. The FROM clause can
include optional JOIN sub clauses to specify the rules for joining tables.
 The WHERE clause includes a comparison predicate, which restricts the rows returned by the query.
The WHERE clause eliminates all rows from the result set for which the comparison predicate does not
evaluate to True.
 The GROUP BY clause is used to project rows having common values into a smaller set of
rows. GROUP BY is often used in conjunction with SQL aggregation functions or to eliminate duplicate
rows from a result set. The WHERE clause is applied before the GROUP BY clause.
 The HAVING clause includes a predicate used to filter rows resulting from the GROUP BY clause.
Because it acts on the results of the GROUP BY clause, aggregation functions can be used in
the HAVING clause predicate.
 The ORDER BY clause identifies which columns are used to sort the resulting data, and in which
direction they should be sorted (options are ascending or descending). Without an ORDER BY clause,
the order of rows returned by an SQL query is undefined

Queuing theory


How to Clone a Hard Drive


How to Clone a Hard Drive


How to Clone a Hard Drive



Did know that you could clone your current Hard Drive without having to by extra software? Maybe you didn't know that all that you needed, was already set up on your current system? Well, it is... and if you follow this tut, you shouldn't have much of a problem.


Make sure that you have a Master and a Slave setup on your system. The Slave drive, in this case, is where all the data on the Master is going to go to.

First: Perform a Scandisk your Master drive and follow that with a thorough Defrag. If you have an Antivirus program, do a thorough sweep with the AV first, then do the Scandisk, followed by the Defrag.

Second: Do the same thing to the target drive, as you did the Master: Scandisk then a thorough Defrag.

Third: Right-click on the Target drive and click on Format. When the box comes up, click your mouse onto the "Full" button.

Fourth: After Formatting the Target drive, run a Scandisk again and click on the button that says "Autofix Errors".

Fifth: In this final part, you might want to cut-and-paste to code in, unless you are sure that you can do it without making any mistakes:

Click on the "Start" button, then click on the "Run..." button, then place the following into the Runbox:

"XCOPY C:\*.*D:\ /c/h/e/k/r" (minus the quotes, of course) then press the "Enter" button.

If you receive an error message, then remove the space from between XCOPY and C:\

Anything that should happen to come up in the DOS box, just click "Y" for "Yes". When its all finished, pull the original Master from the system, designate the Slave as the Master (change your jumpers), then check your new Master out.

This tut has worked and has been tested on all systems except for Windows 2000, so you really shouldn't have any problems. If, by any chance, you should come across a snag, message me and I'll walk you through it.

~cheers~