Skip to content

Commit 7fc42dc

Browse files
Adding templates for Live SQL enabled sprints. (#384)
* Adding EL9 updates to the noVNC lab. * General maintenance on the noVNC lab. * Update 6-labs-setup-graphical-remote-desktop.md * Updates to shared ADB provisioning instructions. * Update provision-body-developer.md * Updating the 'Verify Compute Instance' lab. * Updating the CSS and JS files to support the LiveSQL x Sprints integration * Revert "Updating the CSS and JS files to support the LiveSQL x Sprints integration" This reverts commit d45f8af. * Updating the CSS and JS files to support the LiveSQL x Sprints integration * Adding templates for Live SQL enabled sprints. * Adding templates for Live SQL enabled sprints.
1 parent e07f1eb commit 7fc42dc

File tree

6 files changed

+324
-0
lines changed

6 files changed

+324
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# How can I create tables in the Oracle database?
2+
<!-- If your code can fit in a 2048 character URL, we advise using the sprint-livesql-worksheet template, as this does not require the creation of a Live SQL tutorial. Otherwise, include the link to your tutorial using the src attribute.-->
3+
<livesql-button src="https://livesql.oracle.com/next/worksheet?tutorial=json-duality-views-quick-start-D3wdHG&share_key=jCX1875rL3">
4+
5+
<b>Live SQL Execution:</b> Sign-In Required</br>
6+
<b>Duration:</b> 2 minutes
7+
8+
9+
## Create table in Oracle database
10+
11+
Tables are the basic unit of data storage in an Oracle Database. Data is stored in rows and columns. A CREATE TABLE statement creates a table. Tables contain columns and constraints, rules to which data must conform. Table-level constraints specify a column or columns. Columns have a data type and can specify column constraints (column-level constraints).
12+
13+
```
14+
<copy>
15+
CREATE TABLE table_name (
16+
column1_name data_type column_constraint,
17+
column2_name data_type column_constraint,
18+
...
19+
constraint table_constraint;
20+
);
21+
</copy>
22+
```
23+
24+
### Example
25+
26+
For example, you define a table with a table name, such as employees, and a set of columns. You give each column a column name, such as employee\_id, last\_name, and job\_id; a datatype, such as VARCHAR2, DATE, or NUMBER; and a width. The width can be predetermined by the datatype, as in DATE. If columns are of the NUMBER datatype, define precision and scale instead of width. A row is a collection of column information corresponding to a single record.column information corresponding to a single record.
27+
28+
You can specify rules for each column of a table. These rules are called integrity constraints. One example is a NOT NULL integrity constraint. This constraint forces the column to contain a value in every row.
29+
30+
```
31+
create table DEPARTMENTS (
32+
deptno number,
33+
name varchar2(50) not null,
34+
location varchar2(50),
35+
constraint pk_departments primary key (deptno)
36+
);
37+
```
38+
39+
Tables can declarative specify relationships between tables, typically referred to as referential integrity. To see how this works we can create a "child" table of the DEPARTMENTS table by including a foreign key in the EMPLOYEES table that references the DEPARTMENTS table.
40+
41+
```
42+
create table EMPLOYEES (
43+
empno number,
44+
name varchar2(50) not null,
45+
job varchar2(50),
46+
manager number,
47+
hiredate date,
48+
salary number(7,2),
49+
commission number(7,2),
50+
deptno number,
51+
constraint pk_employees primary key (empno),
52+
constraint fk_employees_deptno foreign key (deptno)
53+
references DEPARTMENTS (deptno)
54+
);
55+
```
56+
57+
Foreign keys must reference primary keys, so to create a "child" table the "parent" table must have a primary key for the foreign key to reference.
58+
59+
## Learn More
60+
61+
* Explore more about [Creating Tables](https://docs.oracle.com/cd/B28359_01/server.111/b28310/tables003.htm#ADMIN11634)
62+
* [Introduction to Oracle SQL Workshop](https://livelabs.oracle.com/pls/apex/dbpm/r/livelabs/view-workshop?wid=943)
63+
* [SQL Language Reference](https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/Introduction-to-Oracle-SQL.html#GUID-049B7AE8-11E1-4110-B3E4-D117907D77AC)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
8+
<meta name="description" content="Oracle LiveLabs gives you access to Oracle's products to run a wide variety of labs and workshops; allowing you to experience our best technology, live!">
9+
<title>Oracle LiveLabs</title>
10+
11+
<script src="https://oracle-livelabs.github.io/common/redwood-hol/js/jquery-1.11.0.min.js"></script>
12+
<script src="https://oracle-livelabs.github.io/common/redwood-hol/js/jquery-ui-1.10.4.custom.js"></script>
13+
<script src="https://oracle-livelabs.github.io/common/redwood-hol/js/main.min.js"></script>
14+
15+
<link rel="stylesheet" href="https://oracle-livelabs.github.io/common/redwood-hol/css/style.min.css" />
16+
<link rel="shortcut icon" href="https://oracle-livelabs.github.io/common/redwood-hol/img/favicon.ico" />
17+
<script src="https://www.oracle.com/us/assets/metrics/ora_apex.js"></script>
18+
</head>
19+
20+
<body>
21+
<header class="hol-Header" role="banner">
22+
<div class="hol-Header-wrap">
23+
<div class="hol-Header-logo"><span>Oracle LiveLabs</span></div>
24+
<a href="https://livelabs.oracle.com" target="_blank" id="livelabs" title="Oracle LiveLabs"></a>
25+
<div class="hol-Header-actions">
26+
<button id="openNav" class="hol-Header-button hol-Header-button--menu rightNav" aria-label="Open Menu"
27+
title="Open Menu">
28+
<span class="hol-Header-toggleIcon"></span>
29+
</button>
30+
</div>
31+
</div>
32+
</header>
33+
34+
<div id="container">
35+
<div id="leftNav">
36+
<div id="toc"></div>
37+
</div>
38+
<div id="contentBox">
39+
<main class="hol-Content" id="module-content"></main>
40+
</div>
41+
</div>
42+
43+
<footer class="hol-Footer">
44+
<a class="hol-Footer-topLink" href="#top">Return to Top</a>
45+
<div id="footer-banner"><div class="footer-row">
46+
<div class="footer-content"><ul class="footer-links">
47+
<li><a href="https://docs.oracle.com/pls/topic/lookup?ctx=en/legal&id=cpyr" target="_blank" aria-label="Open a new window to Oracle legal notices" data-lbl="copyright">© Oracle</a></li>
48+
<li><a href="https://www.oracle.com/corporate/index.html" target="_blank" aria-label="Open a new window to learn more about oracle" data-lbl="about-oracle">About Oracle</a></li>
49+
<li><a href="https://www.oracle.com/corporate/contact/" target="_blank" aria-label="Open a new window to contact oracle" data-lbl="contact-us">Contact Us</a></li>
50+
<li class="footer-links-break"></li>
51+
<li><a href="https://docs.oracle.com/en/browseall.html" target="_blank" aria-label="Open a new window to products a-z" data-lbl="products-a-z">Products A-Z</a></li>
52+
<li><a href="https://www.oracle.com/legal/privacy/" target="_blank" aria-label="Open a new window to read more about Oracle terms of use and privacy" data-lbl="terms-of-use-and-privacy">Terms of Use & Privacy</a></li>
53+
<li><a href="https://www.oracle.com/legal/privacy/privacy-policy.html#11" target="_blank" aria-label="Open a new window to read more about managing Oracle cookie preferences" data-lbl="cookie-preferences">Cookie Preferences</a></li>
54+
<li><a href="https://www.oracle.com/legal/privacy/marketing-cloud-data-cloud-privacy-policy.html#adchoices" target="_blank" aria-label="Open a new window to ad choices" data-lbl="ad-choices">Ad Choices</a></li>
55+
<li class="footer-links-break"></li><li class="last"><a href="https://docs.oracle.com/pls/topic/lookup?ctx=en/legal&id=cpyr" target="_blank" aria-label="Open a new window to Oracle legal notices" data-lbl="copyright">© Oracle</a></li>
56+
</ul>
57+
</div>
58+
</div>
59+
</div>
60+
</footer>
61+
</body>
62+
63+
</html>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"workshoptitle": "LiveLabs Sprints",
3+
"help": "[email protected]",
4+
"tutorials": [
5+
{
6+
"title": "How can I create tables in the Oracle database?",
7+
"description": "",
8+
"filename": "./create-tables.md"
9+
},
10+
{
11+
"title": "How can I insert data into a table in the Oracle database?",
12+
"description": "",
13+
"filename": "../insert-data/insert-data.md"
14+
},
15+
{
16+
"title": "How can I query a table in the Oracle database?",
17+
"description": "",
18+
"filename": "../query-tables/query-tables.md"
19+
},
20+
{
21+
"title": "How can I index columns in the Oracle database?",
22+
"description": "",
23+
"filename": "../index-columns/index-columns.md"
24+
},
25+
{
26+
"title": "How can I create triggers for a table in the Oracle database?",
27+
"description": "",
28+
"filename": "../create-triggers/create-triggers.md"
29+
}
30+
],
31+
"task_type": "Sections",
32+
"hide_button": "true"
33+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# How can I create tables in the Oracle database?
2+
<!-- This HTML tag creates a Live SQL button that takes you to a LiveSQL Worksheet. It will auto-populate that worksheet with the code statements you have wrapped with the <livesql> tag. -->
3+
<livesql-button>
4+
5+
<b>Live SQL Execution:</b> Sign-In Required</br>
6+
<b>Duration:</b> 2 minutes
7+
8+
9+
## Create table in Oracle database
10+
11+
Tables are the basic unit of data storage in an Oracle Database. Data is stored in rows and columns. A CREATE TABLE statement creates a table. Tables contain columns and constraints, rules to which data must conform. Table-level constraints specify a column or columns. Columns have a data type and can specify column constraints (column-level constraints).
12+
13+
```
14+
<copy>
15+
CREATE TABLE table_name (
16+
column1_name data_type column_constraint,
17+
column2_name data_type column_constraint,
18+
...
19+
constraint table_constraint;
20+
);
21+
</copy>
22+
```
23+
24+
### Example
25+
26+
For example, you define a table with a table name, such as employees, and a set of columns. You give each column a column name, such as employee\_id, last\_name, and job\_id; a datatype, such as VARCHAR2, DATE, or NUMBER; and a width. The width can be predetermined by the datatype, as in DATE. If columns are of the NUMBER datatype, define precision and scale instead of width. A row is a collection of column information corresponding to a single record.column information corresponding to a single record.
27+
28+
You can specify rules for each column of a table. These rules are called integrity constraints. One example is a NOT NULL integrity constraint. This constraint forces the column to contain a value in every row.
29+
30+
<!-- Notice how this code is wrapped with the <livesql> tag. -->
31+
```
32+
<livesql>
33+
create table DEPARTMENTS (
34+
deptno number,
35+
name varchar2(50) not null,
36+
location varchar2(50),
37+
constraint pk_departments primary key (deptno)
38+
);
39+
</livesql>
40+
```
41+
42+
Tables can declarative specify relationships between tables, typically referred to as referential integrity. To see how this works we can create a "child" table of the DEPARTMENTS table by including a foreign key in the EMPLOYEES table that references the DEPARTMENTS table.
43+
44+
<!-- Notice how this code is wrapped with the <livesql> tag too. -->
45+
```
46+
<livesql>
47+
create table EMPLOYEES (
48+
empno number,
49+
name varchar2(50) not null,
50+
job varchar2(50),
51+
manager number,
52+
hiredate date,
53+
salary number(7,2),
54+
commission number(7,2),
55+
deptno number,
56+
constraint pk_employees primary key (empno),
57+
constraint fk_employees_deptno foreign key (deptno)
58+
references DEPARTMENTS (deptno)
59+
);
60+
</livesql>
61+
```
62+
63+
Foreign keys must reference primary keys, so to create a "child" table the "parent" table must have a primary key for the foreign key to reference.
64+
65+
## Learn More
66+
67+
* Explore more about [Creating Tables](https://docs.oracle.com/cd/B28359_01/server.111/b28310/tables003.htm#ADMIN11634)
68+
* [Introduction to Oracle SQL Workshop](https://livelabs.oracle.com/pls/apex/dbpm/r/livelabs/view-workshop?wid=943)
69+
* [SQL Language Reference](https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/Introduction-to-Oracle-SQL.html#GUID-049B7AE8-11E1-4110-B3E4-D117907D77AC)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
8+
<meta name="description" content="Oracle LiveLabs gives you access to Oracle's products to run a wide variety of labs and workshops; allowing you to experience our best technology, live!">
9+
<title>Oracle LiveLabs</title>
10+
11+
<script src="https://oracle-livelabs.github.io/common/redwood-hol/js/jquery-1.11.0.min.js"></script>
12+
<script src="https://oracle-livelabs.github.io/common/redwood-hol/js/jquery-ui-1.10.4.custom.js"></script>
13+
<script src="https://oracle-livelabs.github.io/common/redwood-hol/js/main.min.js"></script>
14+
15+
<link rel="stylesheet" href="https://oracle-livelabs.github.io/common/redwood-hol/css/style.min.css" />
16+
<link rel="shortcut icon" href="https://oracle-livelabs.github.io/common/redwood-hol/img/favicon.ico" />
17+
<script src="https://www.oracle.com/us/assets/metrics/ora_apex.js"></script>
18+
</head>
19+
20+
<body>
21+
<header class="hol-Header" role="banner">
22+
<div class="hol-Header-wrap">
23+
<div class="hol-Header-logo"><span>Oracle LiveLabs</span></div>
24+
<a href="https://livelabs.oracle.com" target="_blank" id="livelabs" title="Oracle LiveLabs"></a>
25+
<div class="hol-Header-actions">
26+
<button id="openNav" class="hol-Header-button hol-Header-button--menu rightNav" aria-label="Open Menu"
27+
title="Open Menu">
28+
<span class="hol-Header-toggleIcon"></span>
29+
</button>
30+
</div>
31+
</div>
32+
</header>
33+
34+
<div id="container">
35+
<div id="leftNav">
36+
<div id="toc"></div>
37+
</div>
38+
<div id="contentBox">
39+
<main class="hol-Content" id="module-content"></main>
40+
</div>
41+
</div>
42+
43+
<footer class="hol-Footer">
44+
<a class="hol-Footer-topLink" href="#top">Return to Top</a>
45+
<div id="footer-banner"><div class="footer-row">
46+
<div class="footer-content"><ul class="footer-links">
47+
<li><a href="https://docs.oracle.com/pls/topic/lookup?ctx=en/legal&id=cpyr" target="_blank" aria-label="Open a new window to Oracle legal notices" data-lbl="copyright">© Oracle</a></li>
48+
<li><a href="https://www.oracle.com/corporate/index.html" target="_blank" aria-label="Open a new window to learn more about oracle" data-lbl="about-oracle">About Oracle</a></li>
49+
<li><a href="https://www.oracle.com/corporate/contact/" target="_blank" aria-label="Open a new window to contact oracle" data-lbl="contact-us">Contact Us</a></li>
50+
<li class="footer-links-break"></li>
51+
<li><a href="https://docs.oracle.com/en/browseall.html" target="_blank" aria-label="Open a new window to products a-z" data-lbl="products-a-z">Products A-Z</a></li>
52+
<li><a href="https://www.oracle.com/legal/privacy/" target="_blank" aria-label="Open a new window to read more about Oracle terms of use and privacy" data-lbl="terms-of-use-and-privacy">Terms of Use & Privacy</a></li>
53+
<li><a href="https://www.oracle.com/legal/privacy/privacy-policy.html#11" target="_blank" aria-label="Open a new window to read more about managing Oracle cookie preferences" data-lbl="cookie-preferences">Cookie Preferences</a></li>
54+
<li><a href="https://www.oracle.com/legal/privacy/marketing-cloud-data-cloud-privacy-policy.html#adchoices" target="_blank" aria-label="Open a new window to ad choices" data-lbl="ad-choices">Ad Choices</a></li>
55+
<li class="footer-links-break"></li><li class="last"><a href="https://docs.oracle.com/pls/topic/lookup?ctx=en/legal&id=cpyr" target="_blank" aria-label="Open a new window to Oracle legal notices" data-lbl="copyright">© Oracle</a></li>
56+
</ul>
57+
</div>
58+
</div>
59+
</div>
60+
</footer>
61+
</body>
62+
63+
</html>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"workshoptitle": "LiveLabs Sprints",
3+
"help": "[email protected]",
4+
"tutorials": [
5+
{
6+
"title": "How can I create tables in the Oracle database?",
7+
"description": "",
8+
"filename": "./create-tables.md"
9+
},
10+
{
11+
"title": "How can I insert data into a table in the Oracle database?",
12+
"description": "",
13+
"filename": "../insert-data/insert-data.md"
14+
},
15+
{
16+
"title": "How can I query a table in the Oracle database?",
17+
"description": "",
18+
"filename": "../query-tables/query-tables.md"
19+
},
20+
{
21+
"title": "How can I index columns in the Oracle database?",
22+
"description": "",
23+
"filename": "../index-columns/index-columns.md"
24+
},
25+
{
26+
"title": "How can I create triggers for a table in the Oracle database?",
27+
"description": "",
28+
"filename": "../create-triggers/create-triggers.md"
29+
}
30+
],
31+
"task_type": "Sections",
32+
"hide_button": "true"
33+
}

0 commit comments

Comments
 (0)