Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create SQL commands for all CRUD for tables: users, articles. Create query to count the number of articles written per user. Explain each in detail.

Create SQL commands for all CRUD for tables: users, articles. Create query to count the number of articles written per user. Explain each in detail. 1000 words

SQL

 

CREATE TABLE  Blog_category(

            CATEGORY_NAME       CHAR(30),

            DATE_CREATED        DATE,

            CONSTRAINT PKBlog_category PRIMARY KEY (Symbol)

);

 

CREATE TABLE Blog_post_category(

            CATEGORY_ID           CHAR(20),

            POST_ID               CHAR(20),

            CONSTRAINT PKBlog_post_id PRIMARY KEY (Symbol),

);

 

CREATE TABLE Blog_author(

            FIRST_NAME        CHAR(20),

            LAST_NAME         CHAR(20),

            DISPLAY_NAME      CHAR(20)

            CONSTRAINT PKBlog_author PRIMARY KEY (Symbol),

);  

 

CREATE TABLE Blog_post(

            DATE       DATE,

            TITLE      VARCHAR(50),

            ARTICLE    VARCHAR(500),

            AUTHOR     CHAR(20)

            DATE_PUB   DATE

            COMMENT_ADD VARCHAR(200)

            CONSTRAINT PKBlog_post PRIMARY KEY (Symbol),

            CONSTRAINT FKBlog_post FOREIGN KEY (Symbol) 

);

 

CREATE TABLE Blog_tag(

            BLOG_TITLE  VARCHAR(25),

            BLOG_TAG    VARCHAR (250),

            TAG_WEBSITE VARCHAR (50),

            CONSTRAINT PKBlog_tag PRIMARY KEY (Symbol),

            CONSTRAINT FKBlog_tag FOREIGN KEY (Symbol));

 );

 

CREATE TABLE Blog_comment(

            DATE  DATE,

            POST  VARCHAR(50),

            REPLY   VARCHAR (50)       

            AUTHOR_NAME CHAR(20)

            CONSTRAINT PKBlog_comment PRIMARY KEY (Symbol),

            CONSTRAINT FKBlog_comment FOREIGN KEY (Symbol) 

);

CREATE TABLE Blog_user(

            USER_NAME    CHAR(20),

            USER_EMAIL  VARCHAR(35),

            CONSTRAINT PKBlog_user PRIMARY KEY (Symbol),

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

How do you include a field in an Access query?

Answered: 1 week ago