0% found this document useful (0 votes)
0 views3 pages

SQL Assignment

Uploaded by

Debargha Biswas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views3 pages

SQL Assignment

Uploaded by

Debargha Biswas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Jobs:

Represents job postings. Attributes could include job_id, job_title,


job_description, company_id, salary, location, posted_date, etc.
Applicants:
Represents job seekers. Attributes could include applicant_id, first_name,
last_name, email, phone_number, resume_url, skills, etc.
Companies:
Represents the organizations posting jobs. Attributes could include
company_id, company_name, company_description, website, location,
etc.
Skills:
Represents the skills required for jobs. Attributes could include skill_id,
skill_name.
Applications:
Represents the relationship between applicants and jobs. Attributes could
include application_id, applicant_id, job_id, application_date, status, etc.

2. Define Relationships:
One-to-many:
A company can have many jobs (company_id is a foreign key in the jobs
table).
One-to-many:
A job can have many applications (job_id is a foreign key in the
applications table).
One-to-many:
An applicant can have many applications (applicant_id is a foreign key in
the applications table).
Many-to-many:
An applicant can have many skills, and a skill can be possessed by many
applicants (using a junction table like applicant_skills with applicant_id
and skill_id as foreign keys).

3. Design Tables: (table: tbl_*, field: fld_*, auto-increment: fld_ai_*)

 jobs table (tbl_job):


o job_id (INT, PRIMARY KEY, AUTO_INCREMENT)
o job_title (VARCHAR(255), NOT NULL)
o job_description (TEXT)
o company_id (INT, FOREIGN KEY referencing
companies.company_id)
o salary (DECIMAL(10, 2))
o location (VARCHAR(255))
o posted_date (DATE)
o job_category_id (INT, FOREIGN KEY referencing
job_category.job_category_id)
 applicants table:
o applicant_id (INT, PRIMARY KEY, AUTO_INCREMENT)
o first_name (VARCHAR(255), NOT NULL)
o last_name (VARCHAR(255), NOT NULL)
o email (VARCHAR(255), UNIQUE, NOT NULL)
o phone_number (VARCHAR(20))
o resume_url (VARCHAR(255))
 companies table:
o company_id (INT, PRIMARY KEY, AUTO_INCREMENT)
o company_name (VARCHAR(255), NOT NULL)
o company_description (TEXT)
o website (VARCHAR(255))
o location (VARCHAR(255))

skills table:

skill_id (INT, PRIMARY KEY, AUTO_INCREMENT)

skill_name (VARCHAR(255), NOT NULL)

applications table:

application_id (INT, PRIMARY KEY, AUTO_INCREMENT)

applicant_id (INT, FOREIGN KEY referencing


applicants.applicant_id)

job_id (INT, FOREIGN KEY referencing jobs.job_id)

application_date (DATE)

status (VARCHAR(50))

function enforceWordLimit($textarea, maxWords) {

$textarea.on('input', function () {

let words = this.value.trim().split(/\s+/).filter(w => w.length


> 0);

if (words.length > maxWords) {

// Trim to maxWords and update textarea value

this.value = words.slice(0, maxWords).join(' ');

}
// Optionally, show word count

$('#charCount4').text(` ${words.length}/${maxWords} `);

});

// Usage for artsum textarea (500 word limit)

enforceWordLimit($('#artsum'), 500);

You might also like