Blog link: http://www.rebellionrider.com/sql-primary-key.htm
SQL tutorial on Primary key / SQL Primary key,
In this tutorial you will learn about
simple primary key, composute primary key, how to drop primary key. defining primary key using create table and alter table along with many other things.
Tool used in this tutorial is SQL Developer.
This tutorial series is part of SQL expert exam certification training. if you are preparing for SQL certification you can use my tutorials. This SQL Tutorial is a part of free training.
Copy Cloud referral link || Use this link to join copy cloud and get 20GB of free storage
Thanks for linking, commenting, sharing and watching more of our videos
This is Manish from RebellionRider.com
So Primary Key
There are two types of Primary keys
First is Simple primary Key: Primary key which Involves only one column and
Second is Composite Primary Key: Primary Key which involves more than one column.
We will start with Simple primary key.
You can create Primary key either with Create Table statement of by using Alter table Statement.
Let's define simple primary key using create table statements.
With create table statement we can either define primary key at column level or at table level.
We will start with defining Primary key at column level using create table statement.
You just have to put keyword Primary key after data type and size of column while defining a column of a table. Here oracle server will create a primary key on product id with default constraint name which will be slightly difficult to understand. You can give your own name to your constraint which is also a good practice.
Error report -
ORA-00911: invalid character
00911. 00000 - "invalid character"
*Cause: identifiers may not start with any ASCII character other than
letters and numbers. $#_ are also allowed after the first
character. Identifiers enclosed by doublequotes may contain
any character other than a doublequote. Alternative quotes
(q'#...#') cannot use spaces, tabs, or carriage returns as
delimiters. For all other contexts, consult the SQL Language
when i try to execute this query
CREATE TABLE customer
cust_id NUMBER(3) PRIMARY KEY,
anyone help please
One of the best tutorial class with all the details...Keep Going...
1.I created a table ,and I want to add Primary Key to a table 'Name'.but the name column have null and duplicate values,What should I do?? Can I add it if not what should I do,I dont want any other column as PK but name has the above issues.
2.Can You make a video on various level Certification on Oracle in detail...
+zohaib khalid I suggest you to read this blog on my website http://bit.ly/primary-key at the end of the article I explained how to drop a primary key constraint. Thanks Do make sure to share it with others
First of all I am a hug fan. It is incredible the way you simplify things.
While going through this tutorial I didn't understand the concept of Composite Key.
Because referring to the example you have shown here. I am still having duplicate values for phone number but unique values for customer id.
Marin Community Foundation and Asian Americans/Pacific Islanders in Philanthropy.
Overall, US-born Muslims make up the largest percentage at 34% of all Muslims in the Bay Area, followed by 14% born in Pakistan, 11% in Afghanistan, 10% in India, 3% in Egypt and 2% each in Iran, Jordan, Palestine and Yemen.
Silicon Valley Pakistani-American by the Numbers:
There are 35,000 Pakistani-born Muslims in San Francisco Bay Area, or 14% of the 250,000 Muslims who call the Bay Area home, according to the study. Bay Area Muslim community constitutes 3.5 percent of the area’s total population and is one of the highest concentrations of Muslims in the country.
As of 2013, South Asian Muslims, including Pakistanis, have the highest income levels, with nearly half (49%) of them having a household income above $100,000. In comparison, those groups with the lowest proportion of household incomes above $100,000 were Hispanic Muslims (15%), Afghans (10%), and African American Muslims (10%).
The Bay Area Muslim community is very diverse in terms of race and ethnicity:
South Asians (30%)
African Americans (9%)
Asian/Pacific Islanders (7%)
Based on the survey findings, the majority of Muslims live in the following three counties:
and Contra Costa (12%)
Thousands of Pakistan-born techies are working at Apple, Cisco, Google, Intel, Oracle and hundreds of other high-tech companies from small start-ups to large Fortune 500 corporations. Pakistani-Americans are contributing to what Erik Brynjolfsson and Andrew McAfee describe as "The Second Machine Age" in a recent book with the same title.