Need help with a query to retrieve SW alert details, node and interface details

Hi Team,

I'm new to running sql queries.I would like to write a SQL query that shows you all of the active alerts with alert message,severity,ObjectType,ObjectName . If it is a Node,then I need to have the following info

- Node IP Address

- Node Name

- Node Status

- Severity

and  if it is an Interface

- Interface Name

- Status

- Severity

I really appreciate any help you can provide.

thank you